summaryrefslogtreecommitdiff
path: root/pylint/checkers/python3.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2018-04-12 15:41:55 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2018-04-12 15:41:55 +0200
commit4d278c697aedb8711aa1a9d17626e1181dbe06d2 (patch)
treeb464f0e4d0a76ceb6df9b2ba470e70ec8b0c4708 /pylint/checkers/python3.py
parentea59cef63598cbce3389cdc4fba5bd8cae853e68 (diff)
downloadpylint-git-4d278c697aedb8711aa1a9d17626e1181dbe06d2.tar.gz
Added a new Python 2/3 check for accessing removed urllib functions
Close #1997
Diffstat (limited to 'pylint/checkers/python3.py')
-rw-r--r--pylint/checkers/python3.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/pylint/checkers/python3.py b/pylint/checkers/python3.py
index 583f32690..5b9cabaaa 100644
--- a/pylint/checkers/python3.py
+++ b/pylint/checkers/python3.py
@@ -456,6 +456,11 @@ class Python3Checker(checkers.BaseChecker):
'Used when accessing a field on operator module that has been '
'removed in Python 3.',
{'maxversion': (3, 0)}),
+ 'W1658': ('Accessing a removed attribute on the urllib module',
+ 'deprecated-urllib-function',
+ 'Used when accessing a field on urllib module that has been '
+ 'removed or moved in Python 3.',
+ {'maxversion': (3, 0)}),
}
_bad_builtins = frozenset([
@@ -559,7 +564,20 @@ class Python3Checker(checkers.BaseChecker):
},
'deprecated-operator-function': {
'operator': frozenset({'div'}),
- }
+ },
+ 'deprecated-urllib-function': {
+ 'urllib': frozenset({
+ 'addbase', 'addclosehook', 'addinfo', 'addinfourl', 'always_safe',
+ 'basejoin', 'ftpcache', 'ftperrors', 'ftpwrapper', 'getproxies',
+ 'getproxies_environment', 'getproxies_macosx_sysconf', 'main', 'noheaders',
+ 'pathname2url', 'proxy_bypass', 'proxy_bypass_environment',
+ 'proxy_bypass_macosx_sysconf', 'quote', 'quote_plus', 'reporthook',
+ 'splitattr', 'splithost', 'splitnport', 'splitpasswd', 'splitport',
+ 'splitquery', 'splittag', 'splittype', 'splituser', 'splitvalue', 'unquote',
+ 'unquote_plus', 'unwrap', 'url2pathname', 'urlcleanup', 'urlencode',
+ 'urlopen', 'urlretrieve'
+ }),
+ },
}
if (3, 4) <= sys.version_info < (3, 4, 4):