summaryrefslogtreecommitdiff
path: root/protocols.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2014-02-22 14:57:47 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2014-02-22 14:57:47 +0200
commit209ac5e51f3a7d1ee8f07dad17b6d35cba70137b (patch)
tree6940e84a971ab426f12a6945fafe53aca9a98166 /protocols.py
parent290b8359fbb4960b479798e6dbb53b7a1afba773 (diff)
downloadastroid-git-209ac5e51f3a7d1ee8f07dad17b6d35cba70137b.tar.gz
Don't crash when inferring nodes from with statements, with multiple context managers. Closes #18.
Diffstat (limited to 'protocols.py')
-rw-r--r--protocols.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/protocols.py b/protocols.py
index a26986cb..e66b802c 100644
--- a/protocols.py
+++ b/protocols.py
@@ -311,6 +311,8 @@ nodes.ExceptHandler.assigned_stmts = raise_if_nothing_infered(excepthandler_assi
def with_assigned_stmts(self, node, context=None, asspath=None):
if asspath is None:
for _, vars in self.items:
+ if vars is None:
+ continue
for lst in vars.infer(context):
if isinstance(lst, (nodes.Tuple, nodes.List)):
for item in lst.nodes: