summaryrefslogtreecommitdiff
path: root/Python/traceback.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-10-17 23:05:19 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2013-10-17 23:05:19 +0300
commitae48164c19d799b10981ee6d48207f971be026cd (patch)
tree9d648169bfd47390b1ad883bc4b54590daaccdb1 /Python/traceback.c
parenta51097fdd9d0177b4d856ac1eaa59bc32fb49cc5 (diff)
parent68fc44960e7e678d7dd31f7676df51045d6a38f9 (diff)
downloadcpython-ae48164c19d799b10981ee6d48207f971be026cd.tar.gz
Issue #19276: Fixed the wave module on 64-bit big-endian platforms.
Diffstat (limited to 'Python/traceback.c')
-rw-r--r--Python/traceback.c6
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;
}
}