Kaydet (Commit) 2dd66ce8 authored tarafından Brett Cannon's avatar Brett Cannon

Make the exception message check for malformed UTF-8 source looser so that…

Make the exception message check for malformed UTF-8 source looser so that SyntaxError triggered from UnicodeDecodeError is also acceptable.
üst de4ebfe5
...@@ -19,7 +19,8 @@ class PEP3120Test(unittest.TestCase): ...@@ -19,7 +19,8 @@ class PEP3120Test(unittest.TestCase):
try: try:
import test.badsyntax_pep3120 import test.badsyntax_pep3120
except SyntaxError as msg: 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: else:
self.fail("expected exception didn't occur") self.fail("expected exception didn't occur")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment