summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pep3120.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-08-30 20:07:38 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-08-30 20:07:38 (GMT)
commit2dd66ce8287d8af965068d468e55fe41cc8fbdf5 (patch)
tree64e7cbbc5cea3ce6143a22b3a93404bc8c947f2a /Lib/test/test_pep3120.py
parentde4ebfe5597d503af097cd51ec51cc70fa79d250 (diff)
downloadcpython-2dd66ce8287d8af965068d468e55fe41cc8fbdf5.zip
cpython-2dd66ce8287d8af965068d468e55fe41cc8fbdf5.tar.gz
cpython-2dd66ce8287d8af965068d468e55fe41cc8fbdf5.tar.bz2
Make the exception message check for malformed UTF-8 source looser so that SyntaxError triggered from UnicodeDecodeError is also acceptable.
Diffstat (limited to 'Lib/test/test_pep3120.py')
-rw-r--r--Lib/test/test_pep3120.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_pep3120.py b/Lib/test/test_pep3120.py
index 85da048..09fedf0 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")