summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2003-02-10 08:21:10 (GMT)
committerJust van Rossum <just@letterror.com>2003-02-10 08:21:10 (GMT)
commit3aaf42c6139ed211a59b200130d1d205982b9818 (patch)
treef8bd6b0fd7101701a3eb8f5bc783cea962e59725 /Lib/test/test_builtin.py
parent4adc9abc32a26f5ce5e2dada33d019f31170b5be (diff)
downloadcpython-3aaf42c6139ed211a59b200130d1d205982b9818.zip
cpython-3aaf42c6139ed211a59b200130d1d205982b9818.tar.gz
cpython-3aaf42c6139ed211a59b200130d1d205982b9818.tar.bz2
patch #683515: "Add unicode support to compile(), eval() and exec"
Incorporated nnorwitz's comment re. Py__USING_UNICODE.
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r--Lib/test/test_builtin.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 2e00632..047e93e 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -195,6 +195,8 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, compile)
self.assertRaises(ValueError, compile, 'print 42\n', '<string>', 'badmode')
self.assertRaises(ValueError, compile, 'print 42\n', '<string>', 'single', 0xff)
+ if have_unicode:
+ compile(unicode('print u"\xc3\xa5"\n', 'utf8'), '', 'exec')
def test_complex(self):
class OS:
@@ -309,6 +311,8 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(eval(unicode('c'), globals, locals), 300)
bom = '\xef\xbb\xbf'
self.assertEqual(eval(bom + 'a', globals, locals), 1)
+ self.assertEqual(eval(unicode('u"\xc3\xa5"', 'utf8'), globals),
+ unicode('\xc3\xa5', 'utf8'))
self.assertRaises(TypeError, eval)
self.assertRaises(TypeError, eval, ())