diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-09-15 15:26:40 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:14 -0300 |
commit | 6bf564204fe977dccf94ed58ddea7fd5eaf4a1fa (patch) | |
tree | 8b58405cdf2eb1c2dcd295540037c0896628da39 /libshiboken/sbkenum.cpp | |
parent | 24206196a34b4faeb4b720efcc84747f35accf94 (diff) |
Using Py_TYPE macro instead of direct access to ob_type to work with Python 2.x and 3.x.
Enclosing PyCObject uses inside #ifdefs
Diffstat (limited to 'libshiboken/sbkenum.cpp')
-rw-r--r-- | libshiboken/sbkenum.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libshiboken/sbkenum.cpp b/libshiboken/sbkenum.cpp index f8d284ed7..013e4d77e 100644 --- a/libshiboken/sbkenum.cpp +++ b/libshiboken/sbkenum.cpp @@ -290,7 +290,7 @@ PyTypeObject* newTypeWithName(const char* name, const char* cppName) { PyTypeObject* type = new PyTypeObject; ::memset(type, 0, sizeof(PyTypeObject)); - type->ob_type = &SbkEnumType_Type; + Py_TYPE(type) = &SbkEnumType_Type; type->tp_basicsize = sizeof(SbkEnumObject); type->tp_print = &SbkEnumObject_print; type->tp_repr = &SbkEnumObject_repr; |