summaryrefslogtreecommitdiff
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-01-28 23:29:46 +0000
committerJack Jansen <jack.jansen@cwi.nl>2003-01-28 23:29:46 +0000
commit712bd5ee052205b702e2d7512cddba01f310592d (patch)
tree31551f0288eb8e4a8a572925d762b1c1a1af7650 /Mac
parenta5af151c5095afd63ab676562debce55b992e33e (diff)
downloadcpython-712bd5ee052205b702e2d7512cddba01f310592d.tar.gz
Added a missing INCREF in pathname().
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Modules/file/_Filemodule.c4
-rw-r--r--Mac/Modules/file/filesupport.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/Mac/Modules/file/_Filemodule.c b/Mac/Modules/file/_Filemodule.c
index 8309b35a62..f762e7e886 100644
--- a/Mac/Modules/file/_Filemodule.c
+++ b/Mac/Modules/file/_Filemodule.c
@@ -3026,8 +3026,10 @@ static PyObject *File_pathname(PyObject *_self, PyObject *_args)
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);
diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py
index 26821ddd69..9d6005cef6 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);