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

Unified Diff: flake8-eyeo/flake8_eyeo.py

Issue 29565854: Noissue - Improved accuracy of evaluated expressions for A103 and A207 (Closed)
Patch Set: Rebased Created Oct. 11, 2017, 6:23 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 | flake8-eyeo/tests/A103.py » ('j') | 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
@@ -46,8 +46,9 @@
def evaluate(node):
+ names = {'__builtins__': {'True': True, 'False': False, 'None': None}}
try:
- return eval(compile(ast.Expression(node), '', 'eval'), {})
+ return eval(compile(ast.Expression(node), '', 'eval'), names)
except Exception:
return VOLATILE
« no previous file with comments | « no previous file | flake8-eyeo/tests/A103.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld