From f7f28fc46bc47465e3d36610940241a5ebadef02 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Sat, 11 Aug 2007 21:31:25 +0000 Subject: Fix problem when exec'ing a string with a coding --- Lib/test/test_coding.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Lib/test/test_coding.py') diff --git a/Lib/test/test_coding.py b/Lib/test/test_coding.py index e83015e543..62cf55555b 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) -- cgit v1.2.1