fix [#31597] Operator Preset: Python Warning whenever a preset is executed (seen on Windows)
This commit is contained in:
@@ -421,9 +421,9 @@ static int python_script_exec(bContext *C, const char *fn, struct Text *text,
|
|||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
pystring = MEM_mallocN(strlen(fn) + 32, "pystring");
|
pystring = MEM_mallocN(strlen(fn) + 36, "pystring");
|
||||||
pystring[0] = '\0';
|
pystring[0] = '\0';
|
||||||
sprintf(pystring, "exec(open(r'%s').read())", fn);
|
sprintf(pystring, "f=open(r'%s');exec(f.read());f.close()", fn);
|
||||||
py_result = PyRun_String(pystring, Py_file_input, py_dict, py_dict);
|
py_result = PyRun_String(pystring, Py_file_input, py_dict, py_dict);
|
||||||
MEM_freeN(pystring);
|
MEM_freeN(pystring);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user