diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index 78be5e558db..e833dba04c8 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -29,12 +29,6 @@ * BLI_string_utf8() for unicode conversion. */ -/* TODO, resolve linking errors on win32 */ -#ifndef _WIN32 -/* needed for Py3.6+ to access Py_PyThreadState_Current */ -#define Py_BUILD_CORE -#endif - #include #include @@ -671,8 +665,8 @@ void PyC_SetHomePath(const char *py_path_bundle) bool PyC_IsInterpreterActive(void) { - /* expanded PyThreadState_GET which won't throw an exception */ - return (((PyThreadState *)_Py_atomic_load_relaxed(&_PyThreadState_Current)) != NULL); + /* instead of PyThreadState_Get, which calls Py_FatalError */ + return (PyThreadState_GetDict() != NULL); } /* Would be nice if python had this built in