Merge branch 'master' into blender2.8
[blender.git] / source / blender / python / intern / bpy_interface.c
index 7ca087e..1276721 100644 (file)
@@ -75,6 +75,7 @@
 #include "../generic/blf_py_api.h"
 #include "../generic/idprop_py_api.h"
 #include "../generic/imbuf_py_api.h"
+#include "../gpu/gpu_py_api.h"
 #include "../bmesh/bmesh_py_api.h"
 #include "../mathutils/mathutils.h"
 
@@ -218,6 +219,7 @@ static struct _inittab bpy_internal_modules[] = {
        {"mathutils.kdtree", PyInit_mathutils_kdtree},
 #endif
        {"_bpy_path", BPyInit__bpy_path},
+       {"_gpu", BPyInit_gpu},
        {"bgl", BPyInit_bgl},
        {"blf", BPyInit_blf},
        {"imbuf", BPyInit_imbuf},
@@ -537,7 +539,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. */