diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-04-11 16:22:26 +0000 |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-04-11 16:22:26 +0000 |
commit | 261cc988296ca262f4d7adbe506167e18c3e5cf2 (patch) | |
tree | 4e9033f7fedf807871d7748a8c4781b17aade5b5 /Lib/compiler | |
parent | d2355f5665001aafa04f8d0e9a19bdc25abe020b (diff) | |
download | cpython-261cc988296ca262f4d7adbe506167e18c3e5cf2.tar.gz |
Add lineno attributes to Discard nodes
Diffstat (limited to 'Lib/compiler')
-rw-r--r-- | Lib/compiler/transformer.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/compiler/transformer.py b/Lib/compiler/transformer.py index d32812a704..10d0e51af2 100644 --- a/Lib/compiler/transformer.py +++ b/Lib/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): |