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

Jeremy Hylton jhylton@users.sourceforge.net
Thu, 26 Apr 2001 19:29:20 -0700


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

Modified Files:
	test_scope.py 
Log Message:
Fix 2.1 nested scopes crash reported by Evan Simpson

The new test case demonstrates the bug.  Be more careful in
symtable_resolve_free() to add a var to cells or frees only if it
won't be added under some other rule.  

XXX Add new assertion that will catch this bug.







Index: test_scope.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_scope.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** test_scope.py	2001/04/13 16:51:46	1.14
--- test_scope.py	2001/04/27 02:29:18	1.15
***************
*** 437,438 ****
--- 437,449 ----
  verify(d == {'x': 2, 'y': 7, 'w': 6})
  
+ print "19. var is bound and free in class"
+ 
+ def f(x):
+     class C:
+         def m(self):
+             return x
+         a = x
+     return C
+ 
+ inst = f(3)()
+ verify(inst.a == inst.m())