mirror of
https://github.com/boostorg/python.git
synced 2026-01-25 18:32:24 +00:00
merged from trunk
[SVN r18264]
This commit is contained in:
@@ -6,9 +6,11 @@
|
||||
#ifndef MAKE_INSTANCE_DWA200296_HPP
|
||||
# define MAKE_INSTANCE_DWA200296_HPP
|
||||
|
||||
# include <boost/python/detail/wrap_python.hpp>
|
||||
# include <boost/python/object/instance.hpp>
|
||||
# include <boost/python/converter/registered.hpp>
|
||||
# include <boost/python/detail/decref_guard.hpp>
|
||||
# include <boost/python/detail/none.hpp>
|
||||
|
||||
namespace boost { namespace python { namespace objects {
|
||||
|
||||
@@ -24,6 +26,9 @@ struct make_instance_impl
|
||||
|
||||
PyTypeObject* type = Derived::get_class_object(x);
|
||||
|
||||
if (type == 0)
|
||||
return python::detail::none();
|
||||
|
||||
PyObject* raw_result = type->tp_alloc(
|
||||
type, objects::additional_instance_size<Holder>::value);
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@ struct make_ptr_instance
|
||||
template <class U>
|
||||
static inline PyTypeObject* get_class_object_impl(U const volatile* p)
|
||||
{
|
||||
if (p == 0)
|
||||
return 0;
|
||||
|
||||
PyTypeObject* derived = get_derived_class_object(is_polymorphic<U>::type(), p);
|
||||
if (derived)
|
||||
return derived;
|
||||
|
||||
Reference in New Issue
Block a user