mirror of https://github.com/python/cpython
Added a missing INCREF in pathname().
This commit is contained in:
parent
47a6b13988
commit
60ffc2bafc
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue