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>2009-05-25 17:48:44 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-05-25 17:48:44 +0400
commit6d156a1bab818a8b41dbabca9fb539bde97ad810 (patch)
tree1d3b4632335034d23ec2a137f4b8a348bdecb76e /source/blender/python/intern/bpy_operator.c
parentedd783db737c2ea6b97b3bb982bd643f840ccd0e (diff)
Store the context for python in a static variable with assessor functions - BPy_GetContext/BPy_SetContext,
Still not happy with this in the long term but its less problematic then storing the context in pythons namespace which couldn't be set before importing modules. This might fix a crash quite a few people have reported (but I cant reproduce).
Diffstat (limited to 'source/blender/python/intern/bpy_operator.c')
-rw-r--r--source/blender/python/intern/bpy_operator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index f8dcb1f43a1..b03540fb765 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -126,7 +126,7 @@ static PyObject *pyop_base_call( PyObject * self, PyObject * args, PyObject * k
PointerRNA ptr;
// XXX Todo, work out a better solution for passing on context, could make a tuple from self and pack the name and Context into it...
- bContext *C = (bContext *)PyCObject_AsVoidPtr(PyDict_GetItemString(PyEval_GetGlobals(), "__bpy_context__"));
+ bContext *C = BPy_GetContext();
char *opname = _PyUnicode_AsString(self);