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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user