summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pep263.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_pep263.py')
-rw-r--r--Lib/test/test_pep263.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_pep263.py b/Lib/test/test_pep263.py
index dd13558..cacf1d6 100644
--- a/Lib/test/test_pep263.py
+++ b/Lib/test/test_pep263.py
@@ -16,6 +16,14 @@ class PEP263Test(unittest.TestCase):
b'\\\xd0\x9f'
)
+ def test_compilestring(self):
+ # see #1882
+ c = compile("\n# coding: utf-8\nu = '\xc3\xb3'\n", "dummy", "exec")
+ d = {}
+ exec(c, d)
+ self.assertEqual(d['u'], '\xf3')
+
+
def test_main():
test_support.run_unittest(PEP263Test)