summaryrefslogtreecommitdiff
path: root/rebuilder.py
diff options
context:
space:
mode:
authorJulien Cristau <julien.cristau@logilab.fr>2013-06-19 13:56:29 +0200
committerJulien Cristau <julien.cristau@logilab.fr>2013-06-19 13:56:29 +0200
commit3630cf510922ef1afd15ecf00bbf6e82adcd41b4 (patch)
tree89a2e12a39eead032b82905cd73fce2fc53a31f0 /rebuilder.py
parent2a8aa71a0133a34ca28d81117586ba45d6081cdb (diff)
downloadastroid-git-3630cf510922ef1afd15ecf00bbf6e82adcd41b4.tar.gz
rebuilder: fix handling of python3.3's Try ast nodes
We were setting the wrong parents, which upset pylint. Fixes https://bitbucket.org/logilab/pylint/issue/10/pylint-028-throws-an-exception-after
Diffstat (limited to 'rebuilder.py')
-rw-r--r--rebuilder.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/rebuilder.py b/rebuilder.py
index 47c81138..8a230fcb 100644
--- a/rebuilder.py
+++ b/rebuilder.py
@@ -880,10 +880,10 @@ class TreeRebuilder3k(TreeRebuilder):
newnode.finalbody = [self.visit(n, newnode) for n in node.finalbody]
if node.handlers:
excnode = new.TryExcept()
- _lineno_parent(node, excnode, parent)
- excnode.body = [self.visit(child, newnode) for child in node.body]
- excnode.handlers = [self.visit(child, newnode) for child in node.handlers]
- excnode.orelse = [self.visit(child, newnode) for child in node.orelse]
+ _lineno_parent(node, excnode, newnode)
+ excnode.body = [self.visit(child, excnode) for child in node.body]
+ excnode.handlers = [self.visit(child, excnode) for child in node.handlers]
+ excnode.orelse = [self.visit(child, excnode) for child in node.orelse]
excnode.set_line_info(excnode.last_child())
newnode.body = [excnode]
else: