diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-07-20 15:30:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-07-20 15:30:27 +0400 |
commit | 8bf9a8cb1e18dc784835db5fd869ad14469053a5 (patch) | |
tree | 128afdf3fd901b9fa68e63a9ed6e225ab917af12 /source/blender/python | |
parent | ae7e321c8b810bade6cb5ee6d2e6b35d1f490c6f (diff) |
Added error prints if the text's main is not set.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/generic/bpy_internal_import.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index b8c17d71ac4..733576146b7 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -66,7 +66,10 @@ PyObject *bpy_text_import( char *name, int *found ) *found= 0; - if(!maggie) return NULL; + if(!maggie) { + printf("ERROR: bpy_import_main_set() was not called before running python. this is a bug.\n"); + return NULL; + } if (namelen>21-3) return NULL; /* we know this cant be importable, the name is too long for blender! */ @@ -114,6 +117,11 @@ PyObject *bpy_text_reimport( PyObject *module, int *found ) //XXX Main *maggie= bpy_import_main ? bpy_import_main:G.main; Main *maggie= bpy_import_main; + if(!maggie) { + printf("ERROR: bpy_import_main_set() was not called before running python. this is a bug.\n"); + return NULL; + } + *found= 0; /* get name, filename from the module itself */ |