diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-08-25 15:30:39 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-08-25 15:30:39 -0700 |
commit | 4e8edc666b9e76e4db18b97fdfa9ea342f5a49f2 (patch) | |
tree | 55d183c06413c5610297eb5902e4746e41d13d19 /Python/traceback.c | |
parent | 2dde1cc43c5753ab90fabfeacd83cf33ecd16a7a (diff) | |
parent | 25859fddc08a50f3a624680e86ec55b5703e137f (diff) | |
download | cpython-4e8edc666b9e76e4db18b97fdfa9ea342f5a49f2.tar.gz |
Merge doc fix from 3.3
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; } } |