summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-04-11 16:22:26 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-04-11 16:22:26 (GMT)
commit4c1f42733ce7bc322c707c10b3322665a7a128ea (patch)
tree5270cc6385c602d7037185bcfdc20a4bdc19c1bb /Tools
parent5af105eec996a86500d0b1e81379308b86ec4e38 (diff)
downloadcpython-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.py4
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):