bpo-38080: Added "getproxies" to urllib fixes in the 2to3 tool (GH-16167)

This commit is contained in:
José Roberto Meza Cabrera 2020-03-11 18:51:20 -05:00 committed by GitHub
parent 64838ce717
commit 276a84a0a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -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",

View File

@ -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():

View File

@ -0,0 +1,2 @@
Added support to fix ``getproxies`` in the :mod:`lib2to3.fixes.fix_urllib`
module. Patch by José Roberto Meza Cabrera.