diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-08-10 05:58:10 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-08-10 05:58:10 -0700 |
commit | 2e74d253ec63d110af6e5a55bca22915fe374d60 (patch) | |
tree | b979cae87c256ab318808ca78526c8aaf0e7d09e /Python/traceback.c | |
parent | efdd3f26e3ca6220ddd8f7ce6a97fde9a14db45a (diff) | |
parent | d265ba722d7eebdde6234372287ce58fdd232437 (diff) | |
download | cpython-2e74d253ec63d110af6e5a55bca22915fe374d60.tar.gz |
Issue #18668: Further clarify m_size setting for non-negative values
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; } } |