mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
merge 3.3
This commit is contained in:
commit
33113a3504
1 changed files with 2 additions and 2 deletions
|
@ -260,7 +260,7 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent)
|
|||
if (fd < 0) {
|
||||
Py_DECREF(io);
|
||||
Py_DECREF(binary);
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
found_encoding = PyTokenizer_FindEncodingFilename(fd, filename);
|
||||
encoding = (found_encoding != NULL) ? found_encoding : "utf-8";
|
||||
|
@ -269,7 +269,7 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent)
|
|||
Py_DECREF(io);
|
||||
Py_DECREF(binary);
|
||||
PyMem_FREE(found_encoding);
|
||||
return PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, filename);
|
||||
return 0;
|
||||
}
|
||||
fob = _PyObject_CallMethodId(io, &PyId_TextIOWrapper, "Os", binary, encoding);
|
||||
Py_DECREF(io);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue