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-07-20 15:30:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-07-20 15:30:27 +0400
commit8bf9a8cb1e18dc784835db5fd869ad14469053a5 (patch)
tree128afdf3fd901b9fa68e63a9ed6e225ab917af12 /source/blender/python/generic/bpy_internal_import.c
parentae7e321c8b810bade6cb5ee6d2e6b35d1f490c6f (diff)
Added error prints if the text's main is not set.
Diffstat (limited to 'source/blender/python/generic/bpy_internal_import.c')
-rw-r--r--source/blender/python/generic/bpy_internal_import.c10
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 */