diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-22 16:34:28 +0200 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-22 16:34:28 +0200 |
commit | b2decdab33ce8b74051a8dcddfa409d7f9af8fb1 (patch) | |
tree | d58fc597874e0c5bb3e878ed2b446bcb606f5f04 /Python/traceback.c | |
parent | b69651179a1ac37b3e959a404388ce9fc1b273f8 (diff) | |
parent | edc97951e09d9ea20937dbddf4b0d9b09c6cb463 (diff) | |
download | cpython-b2decdab33ce8b74051a8dcddfa409d7f9af8fb1.tar.gz |
Some compilers complain about 'control reaches end of non-void function'
because they don't understand that Py_FatalError() terminates the program.
Diffstat (limited to 'Python/traceback.c')
-rw-r--r-- | Python/traceback.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/traceback.c b/Python/traceback.c index 74075c9481..4f2e732779 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -13,7 +13,7 @@ #define OFF(x) offsetof(PyTracebackObject, x) -#define PUTS(fd, str) write(fd, str, strlen(str)) +#define PUTS(fd, str) write(fd, str, (int)strlen(str)) #define MAX_STRING_LENGTH 500 #define MAX_FRAME_DEPTH 100 #define MAX_NTHREADS 100 @@ -246,10 +246,12 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent) 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; } } |