[Python-checkins] python/dist/src/Lib/test test_builtin.py,1.10,1.11
jvr@users.sourceforge.net
jvr@users.sourceforge.net
Mon, 10 Feb 2003 00:21:39 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv19147/Lib/test
Modified Files:
test_builtin.py
Log Message:
patch #683515: "Add unicode support to compile(), eval() and exec"
Incorporated nnorwitz's comment re. Py__USING_UNICODE.
Index: test_builtin.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_builtin.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** test_builtin.py 9 Feb 2003 20:38:47 -0000 1.10
--- test_builtin.py 10 Feb 2003 08:21:05 -0000 1.11
***************
*** 196,199 ****
--- 196,201 ----
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):
***************
*** 310,313 ****
--- 312,317 ----
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, ())