[Python-checkins] CVS: python/dist/src/Lib/test test_grammar.py,1.17,1.18

M.-A. Lemburg python-dev@python.org
Tue, 19 Sep 2000 13:59:08 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv15414/Lib/test

Modified Files:
	test_grammar.py 
Log Message:
This patch adds a new Python C API called PyString_AsStringAndSize()
which implements the automatic conversion from Unicode to a string
object using the default encoding.

The new API is then put to use to have eval() and exec accept
Unicode objects as code parameter. This closes bugs #110924
and #113890.

As side-effect, the traditional C APIs PyString_Size() and
PyString_AsString() will also accept Unicode objects as
parameters.

Index: test_grammar.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_grammar.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** test_grammar.py	2000/08/29 04:56:46	1.17
--- test_grammar.py	2000/09/19 20:59:05	1.18
***************
*** 356,359 ****
--- 356,366 ----
  	exec 'z=1+1'
  	if z <> 2: raise TestFailed, 'exec \'z=1+1\''
+ 	z = None
+ 	del z
+ 	exec u'z=1+1\n'
+ 	if z <> 2: raise TestFailed, 'exec u\'z=1+1\'\\n'
+ 	del z
+ 	exec u'z=1+1'
+ 	if z <> 2: raise TestFailed, 'exec u\'z=1+1\''
  f()
  g = {}