From 62d9f8debf26f221b0a552600d651f2b24542eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rogalski?= Date: Mon, 22 May 2017 14:56:11 +0200 Subject: Fix an inference for trying to unpack Uninferable value in context manager (#429) Closes PyCQA/pylint#1463 --- astroid/protocols.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'astroid/protocols.py') diff --git a/astroid/protocols.py b/astroid/protocols.py index c3abc819..f19a9f41 100644 --- a/astroid/protocols.py +++ b/astroid/protocols.py @@ -514,6 +514,11 @@ def with_assigned_stmts(self, node=None, context=None, asspath=None): 'Tried to infer a nonexistent target with index {index} ' 'in {node!r}.', node=self, targets=node, assign_path=asspath, context=context)) + except TypeError: + util.reraise(exceptions.InferenceError( + 'Tried to unpack an non-iterable value ' + 'in {node!r}.', node=self, targets=node, + assign_path=asspath, context=context)) yield obj # Explicit StopIteration to return error information, see comment # in raise_if_nothing_inferred. -- cgit v1.2.1