summaryrefslogtreecommitdiff
path: root/astroid/protocols.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2018-10-10 12:46:29 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2018-10-10 12:46:29 +0200
commit8a0804031159b48edd35acad968e62280c8e12ef (patch)
treea3389752775d37f32801d615aa8695d9bf467e5f /astroid/protocols.py
parent5f04c394bdf52b07b276afb9d15de84ea34fea99 (diff)
downloadastroid-git-8a0804031159b48edd35acad968e62280c8e12ef.tar.gz
Remove some unneeded comments and use yield from
Diffstat (limited to 'astroid/protocols.py')
-rw-r--r--astroid/protocols.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/astroid/protocols.py b/astroid/protocols.py
index a4c5ebcf..7b8834e5 100644
--- a/astroid/protocols.py
+++ b/astroid/protocols.py
@@ -233,13 +233,12 @@ def _resolve_looppart(parts, assign_path, context):
for part in parts:
if part is util.Uninferable:
continue
- # XXX handle __iter__ and log potentially detected errors
if not hasattr(part, "itered"):
continue
try:
itered = part.itered()
except TypeError:
- continue # XXX log error
+ continue
for stmt in itered:
index_node = nodes.Const(index)
try:
@@ -418,8 +417,6 @@ def _resolve_assignment_parts(parts, assign_path, context):
index_node = nodes.Const(index)
try:
assigned = part.getitem(index_node, context)
- # XXX raise a specific exception to avoid potential hiding of
- # unexpected exception ?
except (exceptions.AstroidTypeError, exceptions.AstroidIndexError):
return
@@ -541,8 +538,7 @@ def with_assigned_stmts(self, node=None, context=None, assign_path=None):
except StopIteration:
return None
if assign_path is None:
- for result in _infer_context_manager(self, mgr, context):
- yield result
+ yield from _infer_context_manager(self, mgr, context)
else:
for result in _infer_context_manager(self, mgr, context):
# Walk the assign_path and get the item at the final index.