cookie and not valid in UTF-8: use "<file>" as the filename instead of
reading from NULL.
support.unlink(init_file_name + ext)
support.rmtree(test_package_name)
+ def test_issue9319(self):
+ imp.find_module("test/badsyntax_pep3120")
+
class ReloadTests(unittest.TestCase):
if (badchar) {
/* Need to add 1 to the line number, since this line
has not been counted, yet. */
- filename = PyUnicode_DecodeFSDefault(tok->filename);
+ if (tok->filename != NULL)
+ filename = PyUnicode_DecodeFSDefault(tok->filename);
+ else
+ filename = PyUnicode_FromString("<file>");
if (filename != NULL) {
PyErr_Format(PyExc_SyntaxError,
"Non-UTF-8 code starting with '\\x%.2x' "