mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Added a missing INCREF in pathname().
This commit is contained in:
parent
47a6b13988
commit
60ffc2bafc
2 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue