diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py index e95f911d8ee..cbfd5af2bb7 100644 --- a/Lib/test/test_ucn.py +++ b/Lib/test/test_ucn.py @@ -7,6 +7,7 @@ """#" +import ast import unittest import unicodedata @@ -24,7 +25,7 @@ def checkletter(self, name, code): # Helper that put all \N escapes inside eval'd raw strings, # to make sure this script runs even if the compiler # chokes on \N escapes - res = eval(r'"\N{%s}"' % name) + res = ast.literal_eval(r'"\N{%s}"' % name) self.assertEqual(res, code) return res