diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-06-16 09:24:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-06-16 09:29:25 +0400 |
commit | f325ddb0d7f876587f12464fab51810f118ee06d (patch) | |
tree | 12bd527e0d962697fe33d16dd72849956c1d367e /source/blender | |
parent | 8365cebe32089dc1dc962a42361ceea936ffe82d (diff) |
Fix Python fails to execute text-blocks including non-mbcs chars (T35176, D595)
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/generic/py_capi_utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index 33ff63a9a28..c0004789faa 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -543,8 +543,9 @@ PyObject *PyC_DefaultNameSpace(const char *filename) Py_DECREF(mod_main); /* sys.modules owns now */ PyModule_AddStringConstant(mod_main, "__name__", "__main__"); if (filename) { - /* __file__ mainly for nice UI'ness */ - PyModule_AddObject(mod_main, "__file__", PyUnicode_DecodeFSDefault(filename)); + /* __file__ mainly for nice UI'ness + * note: this wont map to a real file when executing text-blocks and buttons. */ + PyModule_AddObject(mod_main, "__file__", PyC_UnicodeFromByte(filename)); } PyModule_AddObject(mod_main, "__builtins__", interp->builtins); Py_INCREF(interp->builtins); /* AddObject steals a reference */ |