[Python-checkins] CVS: python/dist/src/Lib/test test_scope.py,1.21,1.22

Jeremy Hylton jhylton@users.sourceforge.net
Thu, 13 Dec 2001 11:45:06 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv32164

Modified Files:
	test_scope.py 
Log Message:
Add test for SF bug [ #492403 ] exec() segfaults on closure's func_code


Index: test_scope.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_scope.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** test_scope.py	2001/10/18 16:23:11	1.21
--- test_scope.py	2001/12/13 19:45:04	1.22
***************
*** 462,466 ****
      if kind == 1:       # AV happens when stepping from this line to next
          if des == "":
!             des = "_%s__%s" % (klass.__name__, name)
          return lambda obj: getattr(obj, des)
  
--- 462,467 ----
      if kind == 1:       # AV happens when stepping from this line to next
          if des == "":
! ##            des = "_%s__%s" % (klass.__name__, name)
!             des = "1"
          return lambda obj: getattr(obj, des)
  
***************
*** 472,476 ****
  sys.settrace(None)
  
! print "20. eval with free variables"
  
  def f(x):
--- 473,477 ----
  sys.settrace(None)
  
! print "20. eval and exec with free variables"
  
  def f(x):
***************
*** 484,487 ****
--- 485,495 ----
  else:
      print "eval() should have failed, because code contained free vars"
+ 
+ try:
+     exec g.func_code
+ except TypeError:
+     pass
+ else:
+     print "exec should have failed, because code contained free vars"
  
  warnings.resetwarnings()