mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Fix problem when exec'ing a string with a coding
This commit is contained in:
parent
7ac971243b
commit
f7f28fc46b
2 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue