From 4c1f42733ce7bc322c707c10b3322665a7a128ea Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Wed, 11 Apr 2001 16:22:26 +0000 Subject: Add lineno attributes to Discard nodes --- Lib/compiler/transformer.py | 4 +++- Tools/compiler/compiler/transformer.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Lib/compiler/transformer.py b/Lib/compiler/transformer.py index d32812a..10d0e51 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): 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): -- cgit v0.12