Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-11-22 12:45:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-11-22 12:45:32 +0400
commit93ad97c131c97050f998332300dabd02c3b30e87 (patch)
treeb55c12a93a7c286dd310ed4b922ff450db399fee /source/blender/python/intern/bpy_intern_string.c
parent762016c74602102634ec2e692433c0feab7952e7 (diff)
avoid string -> unicode conversion when registering classes, also avoid unlikely but possible crash if the py-class returns new instances of PyObjects it doesnt own when registering the class.
Diffstat (limited to 'source/blender/python/intern/bpy_intern_string.c')
-rw-r--r--source/blender/python/intern/bpy_intern_string.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_intern_string.c b/source/blender/python/intern/bpy_intern_string.c
index 7c8291d62d3..70ea57bb33f 100644
--- a/source/blender/python/intern/bpy_intern_string.c
+++ b/source/blender/python/intern/bpy_intern_string.c
@@ -38,6 +38,8 @@ PyObject *bpy_intern_str_bl_rna;
PyObject *bpy_intern_str_order;
PyObject *bpy_intern_str_attr;
PyObject *bpy_intern_str___slots__;
+PyObject *bpy_intern_str___name__;
+PyObject *bpy_intern_str___doc__;
void bpy_intern_string_init(void)
{
@@ -47,6 +49,8 @@ void bpy_intern_string_init(void)
bpy_intern_str_order = PyUnicode_FromString("order");
bpy_intern_str_attr = PyUnicode_FromString("attr");
bpy_intern_str___slots__ = PyUnicode_FromString("__slots__");
+ bpy_intern_str___name__ = PyUnicode_FromString("__name__");
+ bpy_intern_str___doc__ = PyUnicode_FromString("__doc__");
}
void bpy_intern_string_exit(void)
@@ -57,4 +61,6 @@ void bpy_intern_string_exit(void)
Py_DECREF(bpy_intern_str_order);
Py_DECREF(bpy_intern_str_attr);
Py_DECREF(bpy_intern_str___slots__);
+ Py_DECREF(bpy_intern_str___name__);
+ Py_DECREF(bpy_intern_str___doc__);
}