|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r70448 - in branches/release: boost/python libs/python libs/python/src/object libs/python/test
From: rwgk_at_[hidden]
Date: 2011-03-22 20:14:56
Author: rwgk
Date: 2011-03-22 20:14:55 EDT (Tue, 22 Mar 2011)
New Revision: 70448
URL: http://svn.boost.org/trac/boost/changeset/70448
Log:
merging current boost/python and libs/python from trunk into release branch
Added:
branches/release/libs/python/class.cpp
- copied unchanged from r70434, /trunk/libs/python/class.cpp
branches/release/libs/python/test/class.cpp
- copied unchanged from r70434, /trunk/libs/python/test/class.cpp
branches/release/libs/python/test/class.py
- copied unchanged from r70434, /trunk/libs/python/test/class.py
Properties modified:
branches/release/boost/python/ (props changed)
branches/release/libs/python/ (props changed)
Text files modified:
branches/release/libs/python/src/object/class.cpp | 9 +++++----
branches/release/libs/python/test/Jamfile.v2 | 1 +
2 files changed, 6 insertions(+), 4 deletions(-)
Modified: branches/release/libs/python/src/object/class.cpp
==============================================================================
--- branches/release/libs/python/src/object/class.cpp (original)
+++ branches/release/libs/python/src/object/class.cpp 2011-03-22 20:14:55 EDT (Tue, 22 Mar 2011)
@@ -303,7 +303,7 @@
// object.
void instance_holder::install(PyObject* self) throw()
{
- assert(Py_TYPE(Py_TYPE(self)) == &class_metatype_object);
+ assert(PyType_IsSubtype(Py_TYPE(Py_TYPE(self)), &class_metatype_object));
m_next = ((objects::instance<>*)self)->objects;
((objects::instance<>*)self)->objects = this;
}
@@ -482,7 +482,8 @@
BOOST_PYTHON_DECL void*
find_instance_impl(PyObject* inst, type_info type, bool null_shared_ptr_only)
{
- if (Py_TYPE(Py_TYPE(inst)) != &class_metatype_object)
+ if (!Py_TYPE(Py_TYPE(inst)) ||
+ !PyType_IsSubtype(Py_TYPE(Py_TYPE(inst)), &class_metatype_object))
return 0;
instance<>* self = reinterpret_cast<instance<>*>(inst);
@@ -727,7 +728,7 @@
void* instance_holder::allocate(PyObject* self_, std::size_t holder_offset, std::size_t holder_size)
{
- assert(Py_TYPE(Py_TYPE(self_)) == &class_metatype_object);
+ assert(PyType_IsSubtype(Py_TYPE(Py_TYPE(self_)), &class_metatype_object));
objects::instance<>* self = (objects::instance<>*)self_;
int total_size_needed = holder_offset + holder_size;
@@ -752,7 +753,7 @@
void instance_holder::deallocate(PyObject* self_, void* storage) throw()
{
- assert(Py_TYPE(Py_TYPE(self_)) == &class_metatype_object);
+ assert(PyType_IsSubtype(Py_TYPE(Py_TYPE(self_)), &class_metatype_object));
objects::instance<>* self = (objects::instance<>*)self_;
if (storage != (char*)self + Py_SIZE(self))
{
Modified: branches/release/libs/python/test/Jamfile.v2
==============================================================================
--- branches/release/libs/python/test/Jamfile.v2 (original)
+++ branches/release/libs/python/test/Jamfile.v2 2011-03-22 20:14:55 EDT (Tue, 22 Mar 2011)
@@ -117,6 +117,7 @@
[ bpl-test defaults ]
[ bpl-test object ]
+[ bpl-test class ]
[ bpl-test list ]
[ bpl-test long ]
[ bpl-test dict ]
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk