diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-12-31 18:17:44 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-12-31 18:17:44 (GMT) |
commit | accb62b28e1d592733b2f678d5737ca3e8c64fc2 (patch) | |
tree | 0b892dc477d250aba141fbf29f63004ac027c8c7 /Lib/compiler/symbols.py | |
parent | 436eadd4555b3172ab366b5a2381085ffc941614 (diff) | |
download | cpython-accb62b28e1d592733b2f678d5737ca3e8c64fc2.zip cpython-accb62b28e1d592733b2f678d5737ca3e8c64fc2.tar.gz cpython-accb62b28e1d592733b2f678d5737ca3e8c64fc2.tar.bz2 |
SF patch [ 597919 ] compiler package and SET_LINENO
A variety of changes from Michael Hudson to get the compiler working
with 2.3. The primary change is the handling of SET_LINENO:
# The set_lineno() function and the explicit emit() calls for
# SET_LINENO below are only used to generate the line number table.
# As of Python 2.3, the interpreter does not have a SET_LINENO
# instruction. pyassem treats SET_LINENO opcodes as a special case.
A few other small changes:
- Remove unused code from pycodegen and pyassem.
- Fix error handling in parsermodule. When PyParser_SimplerParseString()
fails, it sets an exception with detailed info. The parsermodule
was clobbering that exception and replacing it was a generic
"could not parse string" exception. Keep the original exception.
Diffstat (limited to 'Lib/compiler/symbols.py')
-rw-r--r-- | Lib/compiler/symbols.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/compiler/symbols.py b/Lib/compiler/symbols.py index cd7bceb..9f47fa3 100644 --- a/Lib/compiler/symbols.py +++ b/Lib/compiler/symbols.py @@ -249,6 +249,9 @@ class SymbolVisitor: scope = ClassScope(node.name, self.module) if parent.nested or isinstance(parent, FunctionScope): scope.nested = 1 + if node.doc is not None: + scope.add_def('__doc__') + scope.add_def('__module__') self.scopes[node] = scope prev = self.klass self.klass = node.name |