summaryrefslogtreecommitdiffstats
path: root/Python/traceback.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2013-07-21 20:26:13 (GMT)
committerBenjamin Peterson <benjamin@python.org>2013-07-21 20:26:13 (GMT)
commit04b01dc8f78ee8a549e6011ee26d8de5cc6184c4 (patch)
treec686b5f1e86446273f4acaf91acdf0ea276e5a55 /Python/traceback.c
parent8c4c1f6e669453165a31e03b131f089ae1271067 (diff)
downloadcpython-04b01dc8f78ee8a549e6011ee26d8de5cc6184c4.zip
cpython-04b01dc8f78ee8a549e6011ee26d8de5cc6184c4.tar.gz
cpython-04b01dc8f78ee8a549e6011ee26d8de5cc6184c4.tar.bz2
let's not return NULL from functions that should return ints
Diffstat (limited to 'Python/traceback.c')
-rw-r--r--Python/traceback.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/traceback.c b/Python/traceback.c
index 1f611ba..d19c594 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -258,7 +258,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";
@@ -267,7 +267,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);