Merge branch 'master' into blender2.8
[blender.git] / source / blender / python / intern / bpy_interface.c
index ae8e35ae3fce2c6508815bee30c988ae511a95fe..11a233461d86c60d3ab4533d8f2180966ca3817e 100644 (file)
@@ -72,6 +72,7 @@
 #include "../generic/bgl.h"
 #include "../generic/blf_py_api.h"
 #include "../generic/idprop_py_api.h"
+#include "../gawain/gwn_py_api.h"
 #include "../bmesh/bmesh_py_api.h"
 #include "../mathutils/mathutils.h"
 
@@ -212,6 +213,7 @@ static struct _inittab bpy_internal_modules[] = {
        {"mathutils.kdtree", PyInit_mathutils_kdtree},
 #endif
        {"_bpy_path", BPyInit__bpy_path},
+       {"_gawain", BPyInit_gawain},
        {"bgl", BPyInit_bgl},
        {"blf", BPyInit_blf},
        {"bmesh", BPyInit_bmesh},
@@ -530,7 +532,8 @@ static bool python_script_exec(
 
        if (py_dict) {
 #ifdef PYMODULE_CLEAR_WORKAROUND
-               PyModuleObject *mmod = (PyModuleObject *)PyDict_GetItemString(PyThreadState_GET()->interp->modules, "__main__");
+               PyModuleObject *mmod = (PyModuleObject *)PyDict_GetItem(
+                       PyThreadState_GET()->interp->modules, bpy_intern_str___main__);
                PyObject *dict_back = mmod->md_dict;
                /* freeing the module will clear the namespace,
                 * gives problems running classes defined in this namespace being used later. */