Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: flake8-eyeo/flake8_eyeo.py

Issue 29624606: Noissue - Fixed false positive A203 when using "yield from" (Closed)
Patch Set: Created Nov. 29, 2017, 9:40 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: flake8-eyeo/flake8_eyeo.py
===================================================================
--- a/flake8-eyeo/flake8_eyeo.py
+++ b/flake8-eyeo/flake8_eyeo.py
@@ -102,7 +102,13 @@
continue
if docstring and i == 0 and isinstance(node.value, ast.Str):
continue
- if isinstance(node.value, (ast.Call, ast.Yield)):
+
+ non_literal_expr_nodes = (ast.Call, ast.Yield)
+ try:
+ non_literal_expr_nodes += (ast.YieldFrom,)
Sebastian Noack 2017/11/29 21:51:37 This change prevents and A203 to be (incorrectly)
+ except AttributeError:
+ pass
+ if isinstance(node.value, non_literal_expr_nodes):
continue
self.errors.append((node, 'A203 unused expression'))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld