diff options
Diffstat (limited to 'Mac/Modules/file/filesupport.py')
-rw-r--r-- | Mac/Modules/file/filesupport.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py index 26821dd..9d6005c 100644 --- a/Mac/Modules/file/filesupport.py +++ b/Mac/Modules/file/filesupport.py @@ -874,8 +874,10 @@ PyObject *obj; if (!PyArg_ParseTuple(_args, "O", &obj)) return NULL; -if (PyString_Check(obj)) +if (PyString_Check(obj)) { + Py_INCREF(obj); return obj; +} if (PyUnicode_Check(obj)) return PyUnicode_AsEncodedString(obj, "utf8", "strict"); _res = PyObject_CallMethod(obj, "as_pathname", NULL); |