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
path: root/source
diff options
context:
space:
mode:
authorGaia Clary <gaia.clary@machinimatrix.org>2012-05-25 18:08:50 +0400
committerGaia Clary <gaia.clary@machinimatrix.org>2012-05-25 18:08:50 +0400
commit352cd241a3fd203841cb8ec7621f53187d0790c8 (patch)
tree27358cc18f28eb07a901045a0a9284c2e68b2403 /source
parent19705e969ae625b2c0e3bf02862b5a115cc35530 (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.c4
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);
}