diff options
author | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2012-11-27 05:18:54 +0400 |
---|---|---|
committer | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2012-11-27 05:18:54 +0400 |
commit | ff7c690e4064bbb1d6180668625d7b414000e9ea (patch) | |
tree | 4ac96ca8ed5a4e6a7ab1104d0271aba02266ace6 /source/blender/python/generic/bpy_internal_import.c | |
parent | 6b65102c20e9bdafd90f55f60c2a2084d873e809 (diff) | |
parent | 9b32776be349f5e738b449ca1298e65ce1b69d33 (diff) |
Merge w/ trunk: r52086-r52534 (As with last time, the game engine was not merged)soc-2012-swiss_cheese
Diffstat (limited to 'source/blender/python/generic/bpy_internal_import.c')
-rw-r--r-- | source/blender/python/generic/bpy_internal_import.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index ad97ceb68d4..8d146bedb48 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -59,6 +59,19 @@ static PyMethodDef bpy_reload_meth; static PyObject *imp_reload_orig = NULL; /* 'builtins' is most likely PyEval_GetBuiltins() */ + +/** + * \note to the discerning developer, yes - this is nasty + * monkey-patching our own import into Python's builtin 'imp' module. + * + * However Python's alternative is to use import hooks, + * which are implemented in a way that we can't use our own importer as a + * fall-back (instead we must try and fail - raise an exception evert time). + * Since importing from blenders text-blocks is not the common case + * I prefer to use Pythons import by default and fall-back to + * Blenders - which we can only do by intercepting import calls I'm afraid. + * - Campbell + */ void bpy_import_init(PyObject *builtins) { PyObject *item; |