diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-04-11 16:22:26 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-04-11 16:22:26 (GMT) |
commit | 4c1f42733ce7bc322c707c10b3322665a7a128ea (patch) | |
tree | 5270cc6385c602d7037185bcfdc20a4bdc19c1bb /Tools | |
parent | 5af105eec996a86500d0b1e81379308b86ec4e38 (diff) | |
download | cpython-4c1f42733ce7bc322c707c10b3322665a7a128ea.zip cpython-4c1f42733ce7bc322c707c10b3322665a7a128ea.tar.gz cpython-4c1f42733ce7bc322c707c10b3322665a7a128ea.tar.bz2 |
Add lineno attributes to Discard nodes
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/compiler/compiler/transformer.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Tools/compiler/compiler/transformer.py b/Tools/compiler/compiler/transformer.py index d32812a..10d0e51 100644 --- a/Tools/compiler/compiler/transformer.py +++ b/Tools/compiler/compiler/transformer.py @@ -272,7 +272,9 @@ class Transformer: # augassign testlist | testlist ('=' testlist)* exprNode = self.com_node(nodelist[-1]) if len(nodelist) == 1: - return Discard(exprNode) + n = Discard(exprNode) + n.lineno = exprNode.lineno + return n if nodelist[1][0] == token.EQUAL: nodes = [] for i in range(0, len(nodelist) - 2, 2): |