summaryrefslogtreecommitdiff
path: root/protocols.py
diff options
context:
space:
mode:
authorcpopa <devnull@localhost>2014-02-22 14:57:47 +0200
committercpopa <devnull@localhost>2014-02-22 14:57:47 +0200
commit2179fbf23454719f0a7a5b24b8179f1e91a5706b (patch)
tree5795745e397b992638decb38cd7654bc26d83e15 /protocols.py
parent2f034512e3d0e0000185939b7437ad5f05a97f90 (diff)
downloadastroid-2179fbf23454719f0a7a5b24b8179f1e91a5706b.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 a26986c..e66b802 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: