summarylogtreecommitdiffstats
path: root/python3.9_2.patch
diff options
context:
space:
mode:
Diffstat (limited to 'python3.9_2.patch')
-rw-r--r--python3.9_2.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/python3.9_2.patch b/python3.9_2.patch
new file mode 100644
index 000000000000..a1de7b401485
--- /dev/null
+++ b/python3.9_2.patch
@@ -0,0 +1,23 @@
+diff --git a/source/blender/python/generic/bpy_threads.c b/source/blender/python/generic/bpy_threads.c
+index 5507aa73183..4807c1f5071 100644
+--- a/source/blender/python/generic/bpy_threads.c
++++ b/source/blender/python/generic/bpy_threads.c
+@@ -29,14 +29,11 @@
+ /* analogue of PyEval_SaveThread() */
+ BPy_ThreadStatePtr BPY_thread_save(void)
+ {
+- PyThreadState *tstate = PyThreadState_Swap(NULL);
+- /* note: tstate can be NULL when quitting Blender */
+-
+- if (tstate && PyEval_ThreadsInitialized()) {
+- PyEval_ReleaseLock();
++ /* The thread-state can be NULL when quitting Blender. */
++ if (_PyThreadState_UncheckedGet()) {
++ return (BPy_ThreadStatePtr)PyEval_SaveThread();
+ }
+-
+- return (BPy_ThreadStatePtr)tstate;
++ return NULL;
+ }
+
+ /* analogue of PyEval_RestoreThread() */