changeset 191:847575998490

ast_wrapper: fixed bug when no ancestor is found
author Sigurd Meldgaard <stm@daimi.au.dk>
date Wed, 16 Dec 2009 15:26:16 +0100
parents d26bcb7dc691
children 103d020aed2c
files pysmcl/ast_wrapper.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/ast_wrapper.py	Wed Dec 16 15:25:01 2009 +0100
+++ b/pysmcl/ast_wrapper.py	Wed Dec 16 15:26:16 2009 +0100
@@ -18,7 +18,7 @@
     return m
 
 def get_ancestor(node, type):
-    while not isinstance(node, type):
+    while not isinstance(node, type) and not node is None:
         node = node.parent
     return node