summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-08-11 21:31:25 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-08-11 21:31:25 (GMT)
commitf7f28fc46bc47465e3d36610940241a5ebadef02 (patch)
tree97e348b350193dec72cc3bedc5ceed2342e5b6d1 /Lib
parent7ac971243b2e3810f3e94609d3121beac9512bff (diff)
downloadcpython-f7f28fc46bc47465e3d36610940241a5ebadef02.zip
cpython-f7f28fc46bc47465e3d36610940241a5ebadef02.tar.gz
cpython-f7f28fc46bc47465e3d36610940241a5ebadef02.tar.bz2
Fix problem when exec'ing a string with a coding
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_coding.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_coding.py b/Lib/test/test_coding.py
index e83015e..62cf555 100644
--- a/Lib/test/test_coding.py
+++ b/Lib/test/test_coding.py
@@ -21,6 +21,11 @@ class CodingTest(unittest.TestCase):
fp.close()
self.assertRaises(SyntaxError, compile, text, filename, 'exec')
+ def test_exec_valid_coding(self):
+ d = {}
+ exec('# coding: cp949\na = 5\n', d)
+ self.assertEqual(d['a'], 5)
+
def test_main():
test.test_support.run_unittest(CodingTest)