From 56ab3a7c859cf948aa42a5a04ae15dcadb89bbf9 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 17 May 2013 00:12:04 +0200 Subject: Fix compilater warnings on Windows 64-bit --- Python/traceback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/traceback.c') diff --git a/Python/traceback.c b/Python/traceback.c index b928902ef0..c56b23f6cc 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 -- cgit v1.2.1 From 90550e88978f25e2c4452493b5323c7de260fdc4 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 16 Jul 2013 00:32:14 +0200 Subject: Issue #18408: Fix _Py_DisplaySourceLine() Report _Py_FindSourceFile() error, so the error is cleared; and clear io.open(filename) exception on failure. --- Python/traceback.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Python/traceback.c') diff --git a/Python/traceback.c b/Python/traceback.c index c56b23f6cc..8130d4bcec 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -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; } } -- cgit v1.2.1