From eb4052d7b62e50f217aac94959fe7ef4c36213eb Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 6 Dec 2015 16:20:07 +0100 Subject: [PATCH] Fix compile error on Python versions between 3.0.0 and 3.3.3 --- dtool/src/interrogatedb/py_panda.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index 0c4c47f3f3..2755e46ebe 100644 --- a/dtool/src/interrogatedb/py_panda.h +++ b/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; ///////////////////////////////////////////////////////////////////////////////////