Skip to content

Commit e934560

Browse files
authored
Remove obsolete urllib2 (#1248)
In Python 2, you would import using import urllib2. In Python 3, you use import urllib.request.
1 parent b1dc94f commit e934560

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ez_setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import tarfile
2121
import optparse
2222
import subprocess
23+
from urllib.request import urlopen
2324

2425
from distutils import log
2526

@@ -148,10 +149,6 @@ def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
148149
"""
149150
# making sure we use the absolute path
150151
to_dir = os.path.abspath(to_dir)
151-
try:
152-
from urllib.request import urlopen
153-
except ImportError:
154-
from urllib2 import urlopen
155152
tgz_name = "setuptools-%s.tar.gz" % version
156153
url = download_base + tgz_name
157154
saveto = os.path.join(to_dir, tgz_name)

0 commit comments

Comments
 (0)