diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-05-25 18:08:50 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-05-25 18:08:50 +0400 |
commit | 352cd241a3fd203841cb8ec7621f53187d0790c8 (patch) | |
tree | 27358cc18f28eb07a901045a0a9284c2e68b2403 /source | |
parent | 19705e969ae625b2c0e3bf02862b5a115cc35530 (diff) |
fix [#31597] Operator Preset: Python Warning whenever a preset is executed (seen on Windows)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 1d3099db189..0c88c7d9c81 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -421,9 +421,9 @@ static int python_script_exec(bContext *C, const char *fn, struct Text *text, fclose(fp); - pystring = MEM_mallocN(strlen(fn) + 32, "pystring"); + pystring = MEM_mallocN(strlen(fn) + 36, "pystring"); 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); MEM_freeN(pystring); } |