Index: consts.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/consts.py,v retrieving revision 1.5 diff -c -r1.5 consts.py *** consts.py 14 Sep 2001 22:54:48 -0000 1.5 --- consts.py 4 Aug 2005 09:37:52 -0000 *************** *** 8,13 **** --- 8,14 ---- SC_FREE = 3 SC_CELL = 4 SC_UNKNOWN = 5 + SC_REALLY_GLOBAL = 6 CO_OPTIMIZED = 0x0001 CO_NEWLOCALS = 0x0002 Index: symbols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/symbols.py,v retrieving revision 1.16 diff -c -r1.16 symbols.py *** symbols.py 2 Aug 2004 06:09:53 -0000 1.16 --- symbols.py 4 Aug 2005 09:37:53 -0000 *************** *** 1,7 **** """Module symbol-table generator""" from compiler import ast ! from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL, SC_UNKNOWN from compiler.misc import mangle import types --- 1,8 ---- """Module symbol-table generator""" from compiler import ast ! from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL, \ ! SC_UNKNOWN, SC_REALLY_GLOBAL from compiler.misc import mangle import types *************** *** 89,95 **** The scope of a name could be LOCAL, GLOBAL, FREE, or CELL. """ if self.globals.has_key(name): ! return SC_GLOBAL if self.cells.has_key(name): return SC_CELL if self.defs.has_key(name): --- 90,96 ---- The scope of a name could be LOCAL, GLOBAL, FREE, or CELL. """ if self.globals.has_key(name): ! return SC_REALLY_GLOBAL if self.cells.has_key(name): return SC_CELL if self.defs.has_key(name): *************** *** 154,160 **** if sc == SC_UNKNOWN or sc == SC_FREE \ or isinstance(self, ClassScope): self.frees[name] = 1 ! elif sc == SC_GLOBAL: child_globals.append(name) elif isinstance(self, FunctionScope) and sc == SC_LOCAL: self.cells[name] = 1 --- 155,161 ---- if sc == SC_UNKNOWN or sc == SC_FREE \ or isinstance(self, ClassScope): self.frees[name] = 1 ! elif sc == SC_GLOBAL or sc == SC_REALLY_GLOBAL: child_globals.append(name) elif isinstance(self, FunctionScope) and sc == SC_LOCAL: self.cells[name] = 1 Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/pycodegen.py,v retrieving revision 1.73 diff -c -r1.73 pycodegen.py *** pycodegen.py 20 Aug 2004 03:47:13 -0000 1.73 --- pycodegen.py 4 Aug 2005 09:37:56 -0000 *************** *** 8,14 **** from compiler import ast, parse, walk, syntax from compiler import pyassem, misc, future, symbols ! from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL from compiler.consts import CO_VARARGS, CO_VARKEYWORDS, CO_NEWLOCALS,\ CO_NESTED, CO_GENERATOR, CO_GENERATOR_ALLOWED, CO_FUTURE_DIVISION from compiler.pyassem import TupleArg --- 8,15 ---- from compiler import ast, parse, walk, syntax from compiler import pyassem, misc, future, symbols ! from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL, \ ! SC_REALLY_GLOBAL from compiler.consts import CO_VARARGS, CO_VARKEYWORDS, CO_NEWLOCALS,\ CO_NESTED, CO_GENERATOR, CO_GENERATOR_ALLOWED, CO_FUTURE_DIVISION from compiler.pyassem import TupleArg *************** *** 285,290 **** --- 289,296 ---- self.emit(prefix + '_GLOBAL', name) elif scope == SC_FREE or scope == SC_CELL: self.emit(prefix + '_DEREF', name) + elif scope == SC_REALLY_GLOBAL: + self.emit(prefix + '_GLOBAL', name) else: raise RuntimeError, "unsupported scope for var %s: %d" % \ (name, scope)