py/rna update, reload works again.
- fix for reload (f8) crashing, missing incref when creating the script namespace. - store the module names rather then the modules for reloading incase the modules get out of date.
This commit is contained in:
@@ -160,11 +160,10 @@ static PyObject *CreateGlobalDictionary(bContext *C, const char *filename)
|
||||
PyObject *mod_main= PyModule_New("__main__");
|
||||
PyDict_SetItemString(interp->modules, "__main__", mod_main);
|
||||
Py_DECREF(mod_main); /* sys.modules owns now */
|
||||
|
||||
PyModule_AddObject(mod_main, "__builtins__", interp->builtins);
|
||||
PyModule_AddStringConstant(mod_main, "__name__", "__main__");
|
||||
PyModule_AddStringConstant(mod_main, "__file__", filename); /* __file__ only for nice UI'ness */
|
||||
|
||||
PyModule_AddObject(mod_main, "__builtins__", interp->builtins);
|
||||
Py_INCREF(interp->builtins); /* AddObject steals a reference */
|
||||
return PyModule_GetDict(mod_main);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user