summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3
diff options
context:
space:
mode:
authorJosé Roberto Meza Cabrera <robertpro01@gmail.com>2020-03-11 23:51:20 (GMT)
committerGitHub <noreply@github.com>2020-03-11 23:51:20 (GMT)
commit276a84a0a6c694ce227bf36ec2e2e6ec6686170f (patch)
tree3fc4cbfa5ad8570f45f464c8fd47d29b7e58cf0b /Lib/lib2to3
parent64838ce7172c7a92183b39b22504b433a33a884d (diff)
downloadcpython-276a84a0a6c694ce227bf36ec2e2e6ec6686170f.zip
cpython-276a84a0a6c694ce227bf36ec2e2e6ec6686170f.tar.gz
cpython-276a84a0a6c694ce227bf36ec2e2e6ec6686170f.tar.bz2
bpo-38080: Added "getproxies" to urllib fixes in the 2to3 tool (GH-16167)
Diffstat (limited to 'Lib/lib2to3')
-rw-r--r--Lib/lib2to3/fixes/fix_urllib.py2
-rw-r--r--Lib/lib2to3/tests/test_fixers.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/Lib/lib2to3/fixes/fix_urllib.py b/Lib/lib2to3/fixes/fix_urllib.py
index 5a36049..ab892bc 100644
--- a/Lib/lib2to3/fixes/fix_urllib.py
+++ b/Lib/lib2to3/fixes/fix_urllib.py
@@ -13,7 +13,7 @@ MAPPING = {"urllib": [
("urllib.request",
["URLopener", "FancyURLopener", "urlretrieve",
"_urlopener", "urlopen", "urlcleanup",
- "pathname2url", "url2pathname"]),
+ "pathname2url", "url2pathname", "getproxies"]),
("urllib.parse",
["quote", "quote_plus", "unquote", "unquote_plus",
"urlencode", "splitattr", "splithost", "splitnport",
diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers.py
index a285241..121ebe6 100644
--- a/Lib/lib2to3/tests/test_fixers.py
+++ b/Lib/lib2to3/tests/test_fixers.py
@@ -1913,7 +1913,11 @@ def foo():
"""
self.check(b, a)
+ def test_single_import(self):
+ b = "from urllib import getproxies"
+ a = "from urllib.request import getproxies"
+ self.check(b, a)
def test_import_module_usage(self):
for old, changes in self.modules.items():