Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-09-21 16:02:50 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-09-21 16:08:18 +0300
commit7b9bd5b54622eaad122973595ee6cea18dcd13a9 (patch)
tree87f02ee36ae375071517912c5bef410404c19792
parentdf80aeb162ac5def465bb87d95abf851f014f616 (diff)
Recent change for Py3.6 compat caused fatal-error
Revert back to old method, and define Py_BUILD_CORE to expose internals.
-rw-r--r--source/blender/python/generic/py_capi_utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index cd86ed24bcb..a721b9085a5 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -29,6 +29,8 @@
* BLI_string_utf8() for unicode conversion.
*/
+/* needed for Py3.6+ to access Py_PyThreadState_Current */
+#define Py_BUILD_CORE
#include <Python.h>
#include <frameobject.h>
@@ -666,7 +668,8 @@ void PyC_SetHomePath(const char *py_path_bundle)
bool PyC_IsInterpreterActive(void)
{
- return (PyThreadState_GET() != NULL);
+ /* expanded PyThreadState_GET which won't throw an exception */
+ return (((PyThreadState *)_Py_atomic_load_relaxed(&_PyThreadState_Current)) != NULL);
}
/* Would be nice if python had this built in