diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-03-17 20:43:42 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-03-17 20:43:42 (GMT) |
commit | 259314622750c72de2ef377e77a0b70b8d8b2fb5 (patch) | |
tree | 089ad865c7be59bf68fd72e0d5c18c12d831e345 /Lib/test/test_pep263.py | |
parent | ddaa7064ee81c48adc4fdea327892c29179f7845 (diff) | |
download | cpython-259314622750c72de2ef377e77a0b70b8d8b2fb5.zip cpython-259314622750c72de2ef377e77a0b70b8d8b2fb5.tar.gz cpython-259314622750c72de2ef377e77a0b70b8d8b2fb5.tar.bz2 |
Bug #2301: Don't try decoding the source code into the original
encoding for syntax errors.
Diffstat (limited to 'Lib/test/test_pep263.py')
-rw-r--r-- | Lib/test/test_pep263.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_pep263.py b/Lib/test/test_pep263.py index cc126ba..92065c9 100644 --- a/Lib/test/test_pep263.py +++ b/Lib/test/test_pep263.py @@ -23,6 +23,13 @@ class PEP263Test(unittest.TestCase): exec(c, d)
self.assertEqual(d['u'], '\xf3')
+ def test_issue2301(self):
+ try:
+ compile(b"# coding: cp932\nprint '\x94\x4e'", "dummy", "exec")
+ except SyntaxError as v:
+ self.assertEquals(v.text, "print '\u5e74'")
+ else:
+ self.fail()
def test_main():
test_support.run_unittest(PEP263Test)
|