Kaydet (Commit) 60ffc2ba authored tarafından Jack Jansen's avatar Jack Jansen

Added a missing INCREF in pathname().

üst 47a6b139
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment