diff options
-rw-r--r-- | node_classes.py | 4 | ||||
-rw-r--r-- | rebuilder.py | 3 | ||||
-rw-r--r-- | test/unittest_scoped_nodes.py | 6 |
3 files changed, 5 insertions, 8 deletions
diff --git a/node_classes.py b/node_classes.py index a67c416f..0fc83745 100644 --- a/node_classes.py +++ b/node_classes.py @@ -690,8 +690,8 @@ class Raise(Statement): tback = None else: _astng_fields = ('exc', 'cause') - inst = None - tback = None + exc = None + cause = None def raises_not_implemented(self): if not self.exc: diff --git a/rebuilder.py b/rebuilder.py index 9330711c..b5ba9cfc 100644 --- a/rebuilder.py +++ b/rebuilder.py @@ -846,7 +846,8 @@ class TreeRebuilder3k(TreeRebuilder): """visit an ExceptHandler node by returning a fresh instance of it""" newnode = new.ExceptHandler() _lineno_parent(node, newnode, parent) - newnode.type = self.visit(node.type, newnode) + if node.type is not None: + newnode.type = self.visit(node.type, newnode) if node.name is not None: newnode.name = self.visit_assname(node, newnode, node.name) newnode.body = [self.visit(child, newnode) for child in node.body] diff --git a/test/unittest_scoped_nodes.py b/test/unittest_scoped_nodes.py index ae6ef5ce..382a0f57 100644 --- a/test/unittest_scoped_nodes.py +++ b/test/unittest_scoped_nodes.py @@ -122,14 +122,10 @@ del appli self.assertEqual(modname, 'very.multi.utils') modname = mod.relative_to_absolute_name('utils', 0) self.assertEqual(modname, 'very.multi.module.utils') - """ - """ # non package mod.package = False modname = mod.relative_to_absolute_name('utils', 0) self.assertEqual(modname, 'very.multi.utils') - """ - """ modname = mod.relative_to_absolute_name('utils', 1) self.assertEqual(modname, 'very.multi.utils') modname = mod.relative_to_absolute_name('utils', 2) @@ -290,7 +286,7 @@ a = func() """test instance attributes for functions""" data= """ def test(): - print test.bar + print(test.bar) test.bar = 1 test() |