mirror of
https://github.com/boostorg/parameter_python.git
synced 2026-01-27 07:02:12 +00:00
Changed to use Py_TYPE instead of separate code depending on Python version.
This commit is contained in:
@@ -64,24 +64,12 @@ namespace boost { namespace parameter { namespace python { namespace aux
|
||||
0, /* tp_doc */
|
||||
};
|
||||
|
||||
#if PY_MAJOR_VERSION <= 2
|
||||
|
||||
if (unspecified.ob_type == 0)
|
||||
if (Py_TYPE(&unspecified) == 0)
|
||||
{
|
||||
unspecified.ob_type = &PyType_Type;
|
||||
Py_TYPE(&unspecified) = &PyType_Type;
|
||||
PyType_Ready(&unspecified);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
if (unspecified.ob_base.ob_base.ob_type == 0)
|
||||
{
|
||||
unspecified.ob_base.ob_base.ob_type = &PyType_Type;
|
||||
PyType_Ready(&unspecified);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return (PyObject*)&unspecified;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user