[pypy-commit] pypy py3k: our imp.find_module won't raise a SyntaxError like cpython's

pjenvey noreply at buildbot.pypy.org
Fri Mar 1 01:33:58 CET 2013


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r61879:6cc99d28b1ad
Date: 2013-02-28 16:33 -0800
http://bitbucket.org/pypy/pypy/changeset/6cc99d28b1ad/

Log:	our imp.find_module won't raise a SyntaxError like cpython's

diff --git a/lib-python/3.2/test/test_imp.py b/lib-python/3.2/test/test_imp.py
--- a/lib-python/3.2/test/test_imp.py
+++ b/lib-python/3.2/test/test_imp.py
@@ -172,8 +172,15 @@
 
     def test_issue9319(self):
         path = os.path.dirname(__file__)
-        self.assertRaises(SyntaxError,
-                          imp.find_module, "badsyntax_pep3120", [path])
+        try:
+            imp.find_module("badsyntax_pep3120", [path])
+        except SyntaxError:
+            pass
+        else:
+            # PyPy's find_module won't raise a SyntaxError when checking
+            # the file's magic encoding comment, the point of the test
+            # is to ensure no seg fault anyway
+            self.assertTrue(support.check_impl_detail(cpython=False))
 
 
 class ReloadTests(unittest.TestCase):


More information about the pypy-commit mailing list