Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 43b1509

Browse files
committed
Interpreter wasn't displaying the location of a SyntaxError
Issue1692
1 parent 4c3eda3 commit 43b1509

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ What's New in Python 3.0a3?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #1692: Interpreter was not displaying location of SyntaxError
16+
1517
- Improve some exception messages when Windows fails to load an extension
1618
module. Now we get for example '%1 is not a valid Win32 application' instead
1719
of 'error code 193'. Also use Unicode strings to deal with non-English

Python/pythonrun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
11031103
goto finally;
11041104
if (v == Py_None)
11051105
*filename = NULL;
1106-
else if (! (*filename = PyString_AsString(v)))
1106+
else if (! (*filename = PyUnicode_AsString(v)))
11071107
goto finally;
11081108

11091109
Py_DECREF(v);

0 commit comments

Comments
 (0)