From: Brett Cannon Date: Sun, 30 Aug 2009 20:07:38 +0000 (+0000) Subject: Make the exception message check for malformed UTF-8 source looser so that SyntaxErro... X-Git-Tag: v3.2a1~2644 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2dd66ce8287d8af965068d468e55fe41cc8fbdf5;p=thirdparty%2FPython%2Fcpython.git Make the exception message check for malformed UTF-8 source looser so that SyntaxError triggered from UnicodeDecodeError is also acceptable. --- diff --git a/Lib/test/test_pep3120.py b/Lib/test/test_pep3120.py index 85da048a7de5..09fedf0d543a 100644 --- a/Lib/test/test_pep3120.py +++ b/Lib/test/test_pep3120.py @@ -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")