]> granicus.if.org Git - python/commit
Global statements from one function leaked into parallel functions.
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 31 Mar 2009 13:48:15 +0000 (13:48 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 31 Mar 2009 13:48:15 +0000 (13:48 +0000)
commit88f1c042150466f94784526e14842eb694a54735
tree65111f3942688860f7b4f2c41894e62108538312
parent1e6da5c39f7d745841f350d2de8c4461e6b8a397
Global statements from one function leaked into parallel functions.

Re http://bugs.python.org/issue4315

The symbol table used the same name dictionaries to recursively
analyze each of its child blocks, even though the dictionaries are
modified during analysis.  The fix is to create new temporary
dictionaries via the analyze_child_block().  The only information that
needs to propagate back up is the names of the free variables.

Add more comments and break out a helper function.  This code doesn't
get any easier to understand when you only look at it once a year.
Lib/test/test_scope.py
Python/symtable.c