diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-04 09:36:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-04 09:36:07 +0400 |
commit | 3804b2d2ba2d907ee4e84b191d7f551a414b72d5 (patch) | |
tree | 983129a0fb5ac441b5c11565318039a0e1f04365 /source/blender/python/generic | |
parent | 914d3897135fe827b67b5589b028e1974ba52b48 (diff) |
fix [#31856] movieclips.load(filepath=None) or value crash Blender
workaround for python bug/inconsistency
Diffstat (limited to 'source/blender/python/generic')
-rw-r--r-- | source/blender/python/generic/py_capi_utils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index 520773c1ddf..2e4d4e870b8 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -402,6 +402,15 @@ const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce) if (PyBytes_Check(py_str)) { return PyBytes_AS_STRING(py_str); } +#ifdef WIN32 + /* bug [#31856] oddly enough, Python3.2 --> 3.3 on Windows will throw an + * exception here this needs to be fixed in python: + * see: bugs.python.org/issue15859 */ + else if (!PyUnicode_Check(py_str)) { + PyErr_BadArgument(); + return NULL; + } +#endif else if ((*coerce = PyUnicode_EncodeFSDefault(py_str))) { return PyBytes_AS_STRING(*coerce); } |