Added Python 3.5+ compatibility fix

This commit is contained in:
Vlad Frolov authored and GitHub committed 2017-05-19 16:48:55 +03:00
1 parent cf00cc0823
commit 2b34d1ffcc
1 file changed
+4
+4
View File
@@ -111,7 +111,11 @@ typedef intobjargproc ssizeobjargproc;
code_sink.writeln(r'''
#if PY_VERSION_HEX >= 0x03000000
#if PY_VERSION_HEX >= 0x03050000
typedef PyAsyncMethods* cmpfunc;
#else
typedef void* cmpfunc;
#endif
#define PyCObject_FromVoidPtr(a, b) PyCapsule_New(a, NULL, b)
#define PyCObject_AsVoidPtr(a) PyCapsule_GetPointer(a, NULL)
#define PyString_FromString(a) PyBytes_FromString(a)