[Zope-Checkins] CVS: Zope2 - symbols.py:1.4

shane@digicool.com shane@digicool.com
Tue, 26 Jun 2001 15:05:28 -0400 (EDT)


Update of /cvs-repository/Zope2/lib/python/RestrictedPython/compiler
In directory korak.digicool.com:/tmp/cvs-serv21970/compiler

Modified Files:
	symbols.py 
Log Message:
Fixed a nested scopes bug reported by jellej@pacbell.net. Thanks!

Evan's description:

If you defined two nested functions in a row that refer to the same
non-global variable, the second one will be generated as though the
variable were global.



--- Updated File symbols.py in package Zope2 --
--- symbols.py	2001/05/14 21:48:06	1.3
+++ symbols.py	2001/06/26 19:04:57	1.4
@@ -162,12 +162,12 @@
                     child_globals.append(name)
                 elif isinstance(self, FunctionScope) and sc == SC_LOCAL:
                     self.cells[name] = 1
-                else:
+                elif sc != SC_CELL:
                     child_globals.append(name)
             else:
                 if sc == SC_LOCAL:
                     self.cells[name] = 1
-                else:
+                elif sc != SC_CELL:
                     child_globals.append(name)
         return child_globals