summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pep263.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-03-02 23:31:26 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-03-02 23:31:26 (GMT)
commitf5b52246ed8a1191c3aa1da7d3c63bbe11aee020 (patch)
treedcac9a1daca7f583ff958cb61f73e9ed11b5564b /Lib/test/test_pep263.py
parent0663a1ed793c164fb11d3dd62bebc677e260891e (diff)
downloadcpython-f5b52246ed8a1191c3aa1da7d3c63bbe11aee020.zip
cpython-f5b52246ed8a1191c3aa1da7d3c63bbe11aee020.tar.gz
cpython-f5b52246ed8a1191c3aa1da7d3c63bbe11aee020.tar.bz2
ignore the coding cookie in compile(), exec(), and eval() if the source is a string #4626
Diffstat (limited to 'Lib/test/test_pep263.py')
-rw-r--r--Lib/test/test_pep263.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_pep263.py b/Lib/test/test_pep263.py
index 72764f9..05ca47f 100644
--- a/Lib/test/test_pep263.py
+++ b/Lib/test/test_pep263.py
@@ -30,6 +30,12 @@ class PEP263Test(unittest.TestCase):
else:
self.fail()
+ def test_issue4626(self):
+ c = compile("# coding=latin-1\n\u00c6 = '\u00c6'", "dummy", "exec")
+ d = {}
+ exec(c, d)
+ self.assertEquals(d['\xc6'], '\xc6')
+
def test_main():
support.run_unittest(PEP263Test)