diff options
author | Ćukasz Rogalski <rogalski.91@gmail.com> | 2017-05-22 14:56:11 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2017-05-22 14:56:11 +0200 |
commit | 62d9f8debf26f221b0a552600d651f2b24542eef (patch) | |
tree | 22148b87c8450cea43b15ead5f73903ba7a76697 /astroid/protocols.py | |
parent | 3fe2b276e01ca2c09675dffa789b839086f88587 (diff) | |
download | astroid-git-62d9f8debf26f221b0a552600d651f2b24542eef.tar.gz |
Fix an inference for trying to unpack Uninferable value in context manager (#429)
Closes PyCQA/pylint#1463
Diffstat (limited to 'astroid/protocols.py')
-rw-r--r-- | astroid/protocols.py | 5 |
1 files changed, 5 insertions, 0 deletions
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. |