Mercurial > cpython-lru_cache-weakref
diff Python/traceback.c @ 84766:34ca4dd47c54 3.3
let's not return NULL from functions that should return ints
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sun, 21 Jul 2013 13:26:13 -0700 |
| parents | 8fdb83492a58 |
| children | 5607084e2204 c72f4f076d29 |
line wrap: on
line diff
--- a/Python/traceback.c Sun Jul 21 16:24:51 2013 +0200 +++ b/Python/traceback.c Sun Jul 21 13:26:13 2013 -0700 @@ -258,7 +258,7 @@ 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_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);
