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>2010-10-18 15:37:53 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-18 15:37:53 +0400
commitafc8d8b3e3955d809615d9cd82541e5c7f8713ea (patch)
treefce0fcf1e091f912f0a82f77ae5f6fce8a694871 /source/blender/python/generic/bpy_internal_import.c
parent58683fa993e11d7bf888050e359b864f865d7c41 (diff)
bugfix [#24306] Python : relative import error
Diffstat (limited to 'source/blender/python/generic/bpy_internal_import.c')
-rw-r--r--source/blender/python/generic/bpy_internal_import.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index 6d42c794583..3ee0c76a44a 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -198,18 +198,18 @@ static PyObject *blender_import(PyObject *UNUSED(self), PyObject *args, PyObjec
char *name;
int found= 0;
PyObject *globals = NULL, *locals = NULL, *fromlist = NULL;
- PyObject *newmodule;
+ int level= -1; /* relative imports */
+ PyObject *newmodule;
//PyObject_Print(args, stderr, 0);
- int dummy_val; /* what does this do?*/
static char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", 0};
if( !PyArg_ParseTupleAndKeywords( args, kw, "s|OOOi:bpy_import_meth", kwlist,
- &name, &globals, &locals, &fromlist, &dummy_val) )
+ &name, &globals, &locals, &fromlist, &level) )
return NULL;
/* import existing builtin modules or modules that have been imported already */
- newmodule = PyImport_ImportModuleEx( name, globals, locals, fromlist );
+ newmodule= PyImport_ImportModuleLevel(name, globals, locals, fromlist, level);
if(newmodule)
return newmodule;