diff options
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 3 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_intern_string.c | 42 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_intern_string.h | 20 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 2 |
4 files changed, 37 insertions, 30 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 7b0daa91523..cd4d2f7a1c2 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -530,7 +530,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. */ diff --git a/source/blender/python/intern/bpy_intern_string.c b/source/blender/python/intern/bpy_intern_string.c index ac0100fa75d..e9d84b2099b 100644 --- a/source/blender/python/intern/bpy_intern_string.c +++ b/source/blender/python/intern/bpy_intern_string.c @@ -34,21 +34,23 @@ #include "BLI_utildefines.h" -static PyObject *bpy_intern_str_arr[13]; +static PyObject *bpy_intern_str_arr[15]; -PyObject *bpy_intern_str_register; -PyObject *bpy_intern_str_unregister; -PyObject *bpy_intern_str_bl_rna; +PyObject *bpy_intern_str___doc__; +PyObject *bpy_intern_str___main__; +PyObject *bpy_intern_str___module__; +PyObject *bpy_intern_str___name__; +PyObject *bpy_intern_str___slots__; +PyObject *bpy_intern_str_attr; PyObject *bpy_intern_str_bl_property; +PyObject *bpy_intern_str_bl_rna; PyObject *bpy_intern_str_bpy_types; +PyObject *bpy_intern_str_frame; PyObject *bpy_intern_str_order; -PyObject *bpy_intern_str_attr; +PyObject *bpy_intern_str_properties; +PyObject *bpy_intern_str_register; PyObject *bpy_intern_str_self; -PyObject *bpy_intern_str_frame; -PyObject *bpy_intern_str___slots__; -PyObject *bpy_intern_str___name__; -PyObject *bpy_intern_str___doc__; -PyObject *bpy_intern_str___module__; +PyObject *bpy_intern_str_unregister; void bpy_intern_string_init(void) { @@ -57,19 +59,21 @@ void bpy_intern_string_init(void) #define BPY_INTERN_STR(var, str) \ { var = bpy_intern_str_arr[i++] = PyUnicode_FromString(str); } (void)0 - BPY_INTERN_STR(bpy_intern_str_register, "register"); - BPY_INTERN_STR(bpy_intern_str_unregister, "unregister"); - BPY_INTERN_STR(bpy_intern_str_bl_rna, "bl_rna"); + BPY_INTERN_STR(bpy_intern_str___doc__, "__doc__"); + BPY_INTERN_STR(bpy_intern_str___main__, "__main__"); + BPY_INTERN_STR(bpy_intern_str___module__, "__module__"); + BPY_INTERN_STR(bpy_intern_str___name__, "__name__"); + BPY_INTERN_STR(bpy_intern_str___slots__, "__slots__"); + BPY_INTERN_STR(bpy_intern_str_attr, "attr"); BPY_INTERN_STR(bpy_intern_str_bl_property, "bl_property"); + BPY_INTERN_STR(bpy_intern_str_bl_rna, "bl_rna"); BPY_INTERN_STR(bpy_intern_str_bpy_types, "bpy.types"); + BPY_INTERN_STR(bpy_intern_str_frame, "frame"); BPY_INTERN_STR(bpy_intern_str_order, "order"); - BPY_INTERN_STR(bpy_intern_str_attr, "attr"); + BPY_INTERN_STR(bpy_intern_str_properties, "properties"); + BPY_INTERN_STR(bpy_intern_str_register, "register"); BPY_INTERN_STR(bpy_intern_str_self, "self"); - BPY_INTERN_STR(bpy_intern_str_frame, "frame"); - BPY_INTERN_STR(bpy_intern_str___slots__, "__slots__"); - BPY_INTERN_STR(bpy_intern_str___name__, "__name__"); - BPY_INTERN_STR(bpy_intern_str___doc__, "__doc__"); - BPY_INTERN_STR(bpy_intern_str___module__, "__module__"); + BPY_INTERN_STR(bpy_intern_str_unregister, "unregister"); #undef BPY_INTERN_STR diff --git a/source/blender/python/intern/bpy_intern_string.h b/source/blender/python/intern/bpy_intern_string.h index 394e84d89bd..66c469f70bc 100644 --- a/source/blender/python/intern/bpy_intern_string.h +++ b/source/blender/python/intern/bpy_intern_string.h @@ -30,18 +30,20 @@ void bpy_intern_string_init(void); void bpy_intern_string_exit(void); -extern PyObject *bpy_intern_str_register; -extern PyObject *bpy_intern_str_unregister; -extern PyObject *bpy_intern_str_bl_rna; +extern PyObject *bpy_intern_str___doc__; +extern PyObject *bpy_intern_str___main__; +extern PyObject *bpy_intern_str___module__; +extern PyObject *bpy_intern_str___name__; +extern PyObject *bpy_intern_str___slots__; +extern PyObject *bpy_intern_str_attr; extern PyObject *bpy_intern_str_bl_property; +extern PyObject *bpy_intern_str_bl_rna; extern PyObject *bpy_intern_str_bpy_types; +extern PyObject *bpy_intern_str_frame; extern PyObject *bpy_intern_str_order; -extern PyObject *bpy_intern_str_attr; +extern PyObject *bpy_intern_str_properties; +extern PyObject *bpy_intern_str_register; extern PyObject *bpy_intern_str_self; -extern PyObject *bpy_intern_str_frame; -extern PyObject *bpy_intern_str___slots__; -extern PyObject *bpy_intern_str___name__; -extern PyObject *bpy_intern_str___doc__; -extern PyObject *bpy_intern_str___module__; +extern PyObject *bpy_intern_str_unregister; #endif /* __BPY_INTERN_STRING_H__ */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 3c0a5d6dd9a..6f3d0145d87 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1842,7 +1842,7 @@ static int pyrna_py_to_prop( (BPy_StructRNA_Check(value)) && (RNA_struct_is_a(((BPy_StructRNA *)value)->ptr.type, &RNA_Operator))) { - value = PyObject_GetAttrString(value, "properties"); + value = PyObject_GetAttr(value, bpy_intern_str_properties); value_new = value; } |