summaryrefslogtreecommitdiff
path: root/astroid/protocols.py
diff options
context:
space:
mode:
authorƁukasz Rogalski <rogalski.91@gmail.com>2017-03-01 19:47:31 +0100
committerGitHub <noreply@github.com>2017-03-01 19:47:31 +0100
commitbf3d6876c310b39d045f6338ec8b93d2b1967072 (patch)
treeec230c8442a5b67571d8744221bd87a8192a7c5c /astroid/protocols.py
parentace4088b9837fc07a529edbb57b74583168da009 (diff)
downloadastroid-git-bf3d6876c310b39d045f6338ec8b93d2b1967072.tar.gz
Add support for asynchronous comprehensions (#400)
Closes #399
Diffstat (limited to 'astroid/protocols.py')
-rw-r--r--astroid/protocols.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/astroid/protocols.py b/astroid/protocols.py
index a6e6a97c..d1abdea0 100644
--- a/astroid/protocols.py
+++ b/astroid/protocols.py
@@ -242,6 +242,10 @@ def _resolve_looppart(parts, asspath, context):
@decorators.raise_if_nothing_inferred
def for_assigned_stmts(self, node=None, context=None, asspath=None):
+ if isinstance(self, nodes.AsyncFor) or getattr(self, 'is_async', False):
+ # Skip inferring of async code for now
+ raise StopIteration(dict(node=self, unknown=node,
+ assign_path=asspath, context=context))
if asspath is None:
for lst in self.iter.infer(context):
if isinstance(lst, (nodes.Tuple, nodes.List)):