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-26 22:56:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-07-26 22:56:27 +0400
commit6c0e9e21cbd0b20340a1e0bc8f7d06236f3a0909 (patch)
tree1de9cf6fdc851f7cd44d56951b985532d556262e /source/blender/python/intern
parentcbb9dfaab80ed52950a4ea4c1570370eddacfa64 (diff)
indentation error with some operators (strip the descriptions)
if 0'd the exec() workaround for running python scripts incase windows devs want to test. theeth said the problem is when you compile a debug blender against a non debug python (or the ther way I assume), you can get a FILE struct mismatch. A quick way to test this on windows is to run this from the command line. blender -P somescript.py Somescript.py can be anything
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r--source/blender/python/intern/bpy_interface.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 473b3d42095..707c5769357 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -260,6 +260,14 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc
py_result = PyEval_EvalCode( text->compiled, py_dict, py_dict );
} else {
+#if 0
+ char *pystring;
+ pystring= malloc(strlen(fn) + 32);
+ pystring[0]= '\0';
+ sprintf(pystring, "exec(open(r'%s').read())", fn);
+ py_result = PyRun_String( pystring, Py_file_input, py_dict, py_dict );
+ free(pystring);
+#else
FILE *fp= fopen(fn, "r");
if(fp) {
py_result = PyRun_File(fp, fn, Py_file_input, py_dict, py_dict);
@@ -269,7 +277,7 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc
PyErr_Format(PyExc_SystemError, "Python file \"%s\" could not be opened: %s", fn, strerror(errno));
py_result= NULL;
}
-
+#endif
}
if (!py_result) {