diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-15 10:12:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-15 11:00:16 +0300 |
commit | 5531697f6d4a27137dd91996ee80d452b7147a02 (patch) | |
tree | 8c024bc8acac8387a22cc7bfa43ed4d1a5691321 /source/blender/python/intern/bpy_rna.c | |
parent | 1cc3abca701775e0ddb0756a262df99b8e7a0276 (diff) |
Cleanup: remove duplicate context variable (__py_context)
The context was stored both in __py_context & bpy_context_module.
This avoids duplicate functions to update them too.
Diffstat (limited to 'source/blender/python/intern/bpy_rna.c')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 71471474ec0..0ff7893a6e9 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -80,6 +80,11 @@ #define USE_MATHUTILS #define USE_STRING_COERCE +/* Unfortunately Python needs to hold a global reference to the context. + * If we remove this is means `bpy.context` won't be usable from some parts of the code: + * `bpy.app.handler` callbacks for example. + * Even though this is arguably "correct", it's going to cause problems for existing scripts, + * so accept having this for the time being. */ BPy_StructRNA *bpy_context_module = NULL; /* for fast access */ static PyObject *pyrna_struct_Subtype(PointerRNA *ptr); |