]> granicus.if.org Git - python/commitdiff
Make the exception message check for malformed UTF-8 source looser so that SyntaxErro...
authorBrett Cannon <bcannon@gmail.com>
Sun, 30 Aug 2009 20:07:38 +0000 (20:07 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 30 Aug 2009 20:07:38 +0000 (20:07 +0000)
Lib/test/test_pep3120.py

index 85da048a7de5dce3d6830764d32c46540f666f0b..09fedf0d543ac59df80de4198efe59859b0ecaa7 100644 (file)
@@ -19,7 +19,8 @@ class PEP3120Test(unittest.TestCase):
         try:
             import test.badsyntax_pep3120
         except SyntaxError as msg:
-            self.assertTrue(str(msg).find("Non-UTF-8 code starting with") >= 0)
+            msg = str(msg)
+            self.assertTrue('UTF-8' in msg or 'utf8' in msg)
         else:
             self.fail("expected exception didn't occur")