From d603dee4a3d25585103779444e34b8c1a86be065 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Tue, 15 Feb 2000 21:30:48 +0000 Subject: [PATCH] add line numbers to nodes in the except clause (when possible) --- 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 2fb442a5de1..63aac835be0 100644 --- a/Lib/compiler/transformer.py +++ b/Lib/compiler/transformer.py @@ -893,7 +893,9 @@ def com_assign_list(self, node, assigning): return Node('ass_list', assigns) def com_assign_name(self, node, assigning): - return Node('ass_name', node[1], assigning) + n = Node('ass_name', node[1], assigning) + n.lineno = node[2] + return n def com_assign_trailer(self, primary, node, assigning): t = node[1][0] diff --git a/Tools/compiler/compiler/transformer.py b/Tools/compiler/compiler/transformer.py index 2fb442a5de1..63aac835be0 100644 --- a/Tools/compiler/compiler/transformer.py +++ b/Tools/compiler/compiler/transformer.py @@ -893,7 +893,9 @@ def com_assign_list(self, node, assigning): return Node('ass_list', assigns) def com_assign_name(self, node, assigning): - return Node('ass_name', node[1], assigning) + n = Node('ass_name', node[1], assigning) + n.lineno = node[2] + return n def com_assign_trailer(self, primary, node, assigning): t = node[1][0]