diff --git a/parsing.py b/parsing.py index d3063ec0..7c1697fe 100644 --- a/parsing.py +++ b/parsing.py @@ -746,8 +746,10 @@ class Call(object): def parent_stmt(self): if self._parent_stmt: return self._parent_stmt - else: + elif self.parent: return self.parent.parent_stmt + else: + return None @parent_stmt.setter def parent_stmt(self, value): diff --git a/test/completion/classes.py b/test/completion/classes.py index 7b21ecc1..850a4531 100644 --- a/test/completion/classes.py +++ b/test/completion/classes.py @@ -6,7 +6,7 @@ second = "" class TestClass(object): var_class = TestClass(1) - def __init__(self2, first_param, second_param): + def __init__(self2, first_param, second_param, third=1.0): self2.var_inst = first_param self2.second = second_param self2.first = first_param