summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-10-16 13:42:53 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-10-16 13:42:53 +0000
commita92ba0800250ece57c8b4cfa5f8d8fc1558fd024 (patch)
tree1a6ffed729b08f19690e38cbbb81b1881e123543 /Python/pythonrun.c
parent24c7fa3b4d2daf8a3b9d1b3c143e6a55b5b2b4d5 (diff)
downloadcpython-a92ba0800250ece57c8b4cfa5f8d8fc1558fd024.tar.gz
Fix ast_error_finish() and err_input(): filename can be NULL
Fix my previous commit (r85569).
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 8c535fd8a6..f72c9d705a 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -2054,7 +2054,12 @@ err_input(perrdetail *err)
errtext = PyUnicode_DecodeUTF8(err->text, strlen(err->text),
"replace");
}
- filename = PyUnicode_DecodeFSDefault(err->filename);
+ if (err->filename != NULL)
+ filename = PyUnicode_DecodeFSDefault(err->filename);
+ else {
+ Py_INCREF(Py_None);
+ filename = Py_None;
+ }
if (filename != NULL)
v = Py_BuildValue("(NiiN)", filename,
err->lineno, err->offset, errtext);