(original) (raw)
changeset: 84647:2e42c0a39321 user: Victor Stinner victor.stinner@gmail.com date: Tue Jul 16 00:32:14 2013 +0200 files: Python/traceback.c description: Issue #18408: Fix _Py_DisplaySourceLine() Report _Py_FindSourceFile() error, so the error is cleared; and clear io.open(filename) exception on failure. diff -r 71a572a516f9 -r 2e42c0a39321 Python/traceback.c --- a/Python/traceback.c Mon Jul 15 21:16:27 2013 +0200 +++ b/Python/traceback.c Tue Jul 16 00:32:14 2013 +0200 @@ -246,10 +246,12 @@ binary = _PyObject_CallMethodId(io, &PyId_open, "Os", filename, "rb"); if (binary == NULL) { + PyErr_Clear(); + binary = _Py_FindSourceFile(filename, buf, sizeof(buf), io); if (binary == NULL) { Py_DECREF(io); - return 0; + return -1; } } /victor.stinner@gmail.com