summaryrefslogtreecommitdiff
path: root/Python/traceback.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/traceback.c')
-rw-r--r--Python/traceback.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/traceback.c b/Python/traceback.c
index 1a4ec1fd58..be55aa9d50 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -135,6 +135,8 @@ tb_displayline(PyObject *f, char *filename, int lineno, char *name)
FILE *xfp;
char linebuf[2000];
int i;
+ char namebuf[MAXPATHLEN+1];
+
if (filename == NULL || name == NULL)
return -1;
/* This is needed by Emacs' compile command */
@@ -153,7 +155,6 @@ tb_displayline(PyObject *f, char *filename, int lineno, char *name)
Py_ssize_t _npath = PyList_Size(path);
int npath = Py_SAFE_DOWNCAST(_npath, Py_ssize_t, int);
size_t taillen = strlen(tail);
- char namebuf[MAXPATHLEN+1];
for (i = 0; i < npath; i++) {
PyObject *v = PyList_GetItem(path, i);
if (v == NULL) {