aboutsummaryrefslogtreecommitdiffstats
path: root/testing/blender/python-3.8.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2020-01-02 08:06:46 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2020-01-02 11:23:29 +0000
commit8283ba556ffe47eaf56e968ae54e4883dc04143d (patch)
treeae820777f80b4db9e8f5b6e1e1987ced1ac666a6 /testing/blender/python-3.8.patch
parent13b4d2dddb44d7c8268a63912d97380543ed30ff (diff)
downloadaports-8283ba556ffe47eaf56e968ae54e4883dc04143d.tar.bz2
aports-8283ba556ffe47eaf56e968ae54e4883dc04143d.tar.xz
testing/blender: upgrade to 2.81a
Diffstat (limited to 'testing/blender/python-3.8.patch')
-rw-r--r--testing/blender/python-3.8.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/testing/blender/python-3.8.patch b/testing/blender/python-3.8.patch
new file mode 100644
index 0000000000..c26934e344
--- /dev/null
+++ b/testing/blender/python-3.8.patch
@@ -0,0 +1,49 @@
+Index: blender-2.80_patched/source/blender/python/generic/py_capi_utils.c
+===================================================================
+--- blender-2.80_patched/source/blender/python/generic/py_capi_utils.c
++++ blender-2.80_patched/source/blender/python/generic/py_capi_utils.c
+@@ -717,9 +717,11 @@
+ ****************************************************************************/
+ PyObject *PyC_DefaultNameSpace(const char *filename)
+ {
+- PyInterpreterState *interp = PyThreadState_GET()->interp;
++ PyObject *modules = PyImport_GetModuleDict();
++ PyObject *builtins = PyDict_GetItemString(modules, "builtins");
++
+ PyObject *mod_main = PyModule_New("__main__");
+- PyDict_SetItemString(interp->modules, "__main__", mod_main);
++ PyDict_SetItemString(modules, "__main__", mod_main);
+ Py_DECREF(mod_main); /* sys.modules owns now */
+ PyModule_AddStringConstant(mod_main, "__name__", "__main__");
+ if (filename) {
+@@ -727,8 +729,8 @@
+ * note: this wont map to a real file when executing text-blocks and buttons. */
+ PyModule_AddObject(mod_main, "__file__", PyC_UnicodeFromByte(filename));
+ }
+- PyModule_AddObject(mod_main, "__builtins__", interp->builtins);
+- Py_INCREF(interp->builtins); /* AddObject steals a reference */
++ PyModule_AddObject(mod_main, "__builtins__", builtins);
++ Py_INCREF(builtins); /* AddObject steals a reference */
+ return PyModule_GetDict(mod_main);
+ }
+
+@@ -755,15 +757,15 @@
+ /* restore MUST be called after this */
+ void PyC_MainModule_Backup(PyObject **main_mod)
+ {
+- PyInterpreterState *interp = PyThreadState_GET()->interp;
+- *main_mod = PyDict_GetItemString(interp->modules, "__main__");
++ PyObject *modules = PyImport_GetModuleDict();
++ *main_mod = PyDict_GetItemString(modules, "__main__");
+ Py_XINCREF(*main_mod); /* don't free */
+ }
+
+ void PyC_MainModule_Restore(PyObject *main_mod)
+ {
+- PyInterpreterState *interp = PyThreadState_GET()->interp;
+- PyDict_SetItemString(interp->modules, "__main__", main_mod);
++ PyObject *modules = PyImport_GetModuleDict();
++ PyDict_SetItemString(modules, "__main__", main_mod);
+ Py_XDECREF(main_mod);
+ }
+