do a backport of r75928
The added test does not fail without the patch, but we still fix the issue of
surrogates being used in wide builds where they should not be.
diff --git a/Lib/test/test_pep263.py b/Lib/test/test_pep263.py
index b7bb5a2..e4faa9f 100644
--- a/Lib/test/test_pep263.py
+++ b/Lib/test/test_pep263.py
@@ -23,6 +23,13 @@
self.assertEqual(d['u'], u'\xf3')
+ def test_issue3297(self):
+ c = compile("a, b = '\U0001010F', '\\U0001010F'", "dummy", "exec")
+ d = {}
+ exec(c, d)
+ self.assertEqual(d['a'], d['b'])
+ self.assertEqual(len(d['a']), len(d['b']))
+
def test_main():
test_support.run_unittest(PEP263Test)