Issue #9319: Fix a crash on parsing a Python source code without encoding
cookie and not valid in UTF-8: use "<file>" as the filename instead of
reading from NULL.
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index d745ae9..6f5b06a 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -170,6 +170,9 @@
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):