summaryrefslogtreecommitdiff
path: root/checkers/base.py
diff options
context:
space:
mode:
authorcpopa <devnull@localhost>2013-08-02 12:32:47 +0300
committercpopa <devnull@localhost>2013-08-02 12:32:47 +0300
commit223ecc8e017662c60b6e5fed1f7cec4893a89cd3 (patch)
tree19496cc08884dc625a1fb806fb91b3fe0c7caa8a /checkers/base.py
parentf1b0ea4a88aeaa100865a056f9321c9646565bb9 (diff)
parent1f5d694f0af58af8c5a6032dc4d57b08653500d5 (diff)
downloadpylint-exec.tar.gz
merge with Pylint defaultexec
Diffstat (limited to 'checkers/base.py')
-rw-r--r--checkers/base.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/checkers/base.py b/checkers/base.py
index bb6f778..de40c4c 100644
--- a/checkers/base.py
+++ b/checkers/base.py
@@ -374,12 +374,10 @@ functions, methods
'duplicate-key',
"Used when a dictionary expression binds the same key multiple \
times."),
- 'W0122': ('Use of the exec statement',
- 'exec-statement',
- 'Used when you use the "exec" statement, to discourage its \
- usage. That doesn\'t mean you can not use it !',
- {'maxversion': (3, 0)}),
-
+ 'W0122': ('Use of exec',
+ 'exec-used',
+ 'Used when you use the "exec" statement (function for Python 3), to discourage its \
+ usage. That doesn\'t mean you can not use it !'),
'W0141': ('Used builtin function %r',
'bad-builtin',
'Used when a black listed builtin function is used (see the '
@@ -595,12 +593,12 @@ functions, methods
if node.exc is not None and node.inst is not None and node.tback is None:
self.add_message('old-raise-syntax', node=node)
- @check_messages('exec-statement')
+ @check_messages('exec-used')
def visit_exec(self, node):
"""just print a warning on exec statements"""
- self.add_message('exec-statement', node=node)
+ self.add_message('exec-used', node=node)
- @check_messages('bad-builtin', 'star-args')
+ @check_messages('bad-builtin', 'star-args', 'exec-used')
def visit_callfunc(self, node):
"""visit a CallFunc node -> check if this is not a blacklisted builtin
call and check for * or ** use
@@ -611,6 +609,8 @@ functions, methods
# locals nor globals scope)
if not (name in node.frame() or
name in node.root()):
+ if name == 'exec':
+ self.add_message('exec-used', node=node)
if name in self.config.bad_functions:
self.add_message('bad-builtin', node=node, args=name)
if node.starargs or node.kwargs: