mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix ast_error_finish() and err_input(): filename can be NULL
Fix my previous commit (r85569).
This commit is contained in:
parent
4c7c8c3023
commit
2f2ed1f36c
2 changed files with 12 additions and 2 deletions
|
@ -131,7 +131,12 @@ ast_error_finish(const char *filename)
|
|||
Py_INCREF(Py_None);
|
||||
loc = Py_None;
|
||||
}
|
||||
filename_obj = PyUnicode_DecodeFSDefault(filename);
|
||||
if (filename != NULL)
|
||||
filename_obj = PyUnicode_DecodeFSDefault(filename);
|
||||
else {
|
||||
Py_INCREF(Py_None);
|
||||
filename_obj = Py_None;
|
||||
}
|
||||
if (filename_obj != NULL)
|
||||
tmp = Py_BuildValue("(NlOO)", filename_obj, lineno, offset, loc);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue