diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-18 16:34:19 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-18 16:34:19 +0400 |
commit | 35b3736b16bfb604c2eb56eee9afb1a15dbbafea (patch) | |
tree | 93d6ecd0f7e249b2bb8f252e8ffe3f3c77312103 /source/blender/python/generic | |
parent | a558eed3e48eb6652e6613e69663fc34af09ac9f (diff) |
Fix #31856: movieclips.load(filepath=None) or value crash Blender
Disallow running PyUnicode_EncodeFSDefault for None type which seems
to be an issue on Windows.
Diffstat (limited to 'source/blender/python/generic')
-rw-r--r-- | source/blender/python/generic/py_capi_utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index fd12f7f483d..f487414956c 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -384,7 +384,10 @@ const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce) else { PyErr_Clear(); - if (PyBytes_Check(py_str)) { + if (py_str == Py_None) { + return NULL; + } + else if (PyBytes_Check(py_str)) { return PyBytes_AS_STRING(py_str); } else if ((*coerce = PyUnicode_EncodeFSDefault(py_str))) { |