diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2018-04-12 15:32:46 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-04-12 15:33:50 +0200 |
commit | 9c7ea46b0c411659383d4948a54481fbddfb8df0 (patch) | |
tree | 954ec34ec42edac30c9b660cd00b2def7862284f /pylint/checkers/python3.py | |
parent | bcad9bafedd9e8a46be784293c8dc57920a0ea1e (diff) | |
download | pylint-git-9c7ea46b0c411659383d4948a54481fbddfb8df0.tar.gz |
Added a new Python 2/3 check for accessing `operator.div`, which is removed in Python 3
Close #1936
Diffstat (limited to 'pylint/checkers/python3.py')
-rw-r--r-- | pylint/checkers/python3.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pylint/checkers/python3.py b/pylint/checkers/python3.py index ec32f87d3..be83667e5 100644 --- a/pylint/checkers/python3.py +++ b/pylint/checkers/python3.py @@ -448,6 +448,11 @@ class Python3Checker(checkers.BaseChecker): 'Used when dict.values is referenced in a non-iterating ' 'context (returns an iterator in Python 3)', {'maxversion': (3, 0)}), + 'W1657': ('Accessing a removed attribute on the operator module', + 'deprecated-operator-function', + 'Used when accessing a field on operator module that has been ' + 'removed in Python 3.', + {'maxversion': (3, 0)}), } _bad_builtins = frozenset([ @@ -548,6 +553,9 @@ class Python3Checker(checkers.BaseChecker): 'lowercase', 'letters', 'uppercase', 'atol_error', 'atof_error', 'atoi_error', 'index_error' ]) + }, + 'deprecated-operator-function': { + 'operator': frozenset({'div'}), } } |