Browse Source

Fix compile error on Python versions between 3.0.0 and 3.3.3

rdb 10 years ago
parent
commit
eb4052d7b6
1 changed files with 6 additions and 0 deletions
  1. 6 0
      dtool/src/interrogatedb/py_panda.h

+ 6 - 0
dtool/src/interrogatedb/py_panda.h

@@ -131,6 +131,12 @@ inline PyObject* doPy_RETURN_FALSE()
 typedef long Py_hash_t;
 #endif
 
+#if PY_MAJOR_VERSION >= 3
+// Python 3 versions before 3.3.3 defined this incorrectly.
+#undef _PyErr_OCCURRED
+#define _PyErr_OCCURRED() (PyThreadState_GET()->curexc_type)
+#endif
+
 using namespace std;
 
 ///////////////////////////////////////////////////////////////////////////////////