diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-09-16 18:24:56 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:15 -0300 |
commit | 0b1f8df512047c6ace60701180ec1e4f6e97484e (patch) | |
tree | 6ed9d3410038fd37d600f548d0f8df5be111a55a /libshiboken | |
parent | cbfebc05a591a2370c3fad044e7a45a305c8ba4a (diff) |
Port module initialization to Python3.
Diffstat (limited to 'libshiboken')
-rw-r--r-- | libshiboken/sbkpython.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libshiboken/sbkpython.h b/libshiboken/sbkpython.h index d1653d792..007a378b7 100644 --- a/libshiboken/sbkpython.h +++ b/libshiboken/sbkpython.h @@ -37,12 +37,16 @@ #define SbkNumber_Check PyNumber_Check #define Py_TPFLAGS_CHECKTYPES 0 + #define SBK_NB_BOOL(x) (x).nb_bool #define SBK_STR_NAME "bytes" + #define SBK_PyMethod_New PyMethod_New #else // Note: if there wasn't for the old-style classes, only a PyNumber_Check would suffice. #define SbkNumber_Check(X) \ (PyNumber_Check(X) && (!PyInstance_Check(X) || PyObject_HasAttrString(X, "__trunc__"))) + #define SBK_NB_BOOL(x) (x).nb_nonzero #define SBK_STR_NAME "str" + #define SBK_PyMethod_New(X, Y) PyMethod_New(X, Y, (PyObject*)Py_TYPE(Y)) #endif #endif |