Fix my previous commit (r85569).
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
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);