diff options
-rw-r--r-- | Lib/compiler/transformer.py | 4 | ||||
-rw-r--r-- | 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): |