diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-30 15:44:24 +0200 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-30 15:44:24 +0200 |
commit | 9eac7fc687b14ae094d164f7c12cae69133141fd (patch) | |
tree | 6424c938d05a78c528028a06bb1eb5f008fe0a1d /Python/traceback.c | |
parent | 0f8df8635934e1a1eada1a8a6fc8e98b8b9353b3 (diff) | |
parent | e262040fdc43d4b6d5dd474e066e8c2ba211e81c (diff) | |
download | cpython-9eac7fc687b14ae094d164f7c12cae69133141fd.tar.gz |
Add simple test for resource.getpagesize()
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; } } |