summaryrefslogtreecommitdiff
path: root/libs/python/src/object/class.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/python/src/object/class.cpp')
-rw-r--r--libs/python/src/object/class.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/libs/python/src/object/class.cpp b/libs/python/src/object/class.cpp
index 179ec98..aeef688 100644
--- a/libs/python/src/object/class.cpp
+++ b/libs/python/src/object/class.cpp
@@ -616,11 +616,9 @@ namespace objects
void class_base::add_property(
char const* name, object const& fget, char const* docstr)
{
- union { PyTypeObject *ptop; PyObject *pop; }pun = { &PyProperty_Type };
-
object property(
(python::detail::new_reference)
- PyObject_CallFunction(pun.pop, const_cast<char*>("Osss"), fget.ptr(), 0, 0, docstr));
+ PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast<char*>("Osss"), fget.ptr(), 0, 0, docstr));
this->setattr(name, property);
}
@@ -628,11 +626,9 @@ namespace objects
void class_base::add_property(
char const* name, object const& fget, object const& fset, char const* docstr)
{
- union { PyTypeObject *ptop; PyObject *pop; }pun = { &PyProperty_Type };
-
object property(
(python::detail::new_reference)
- PyObject_CallFunction(pun.pop, const_cast<char*>("OOss"), fget.ptr(), fset.ptr(), 0, docstr));
+ PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast<char*>("OOss"), fget.ptr(), fset.ptr(), 0, docstr));
this->setattr(name, property);
}