Commit aae75a3d authored by Jason R. Coombs's avatar Jason R. Coombs

Move import to the top

parent 02abac66
...@@ -26,6 +26,11 @@ import contextlib ...@@ -26,6 +26,11 @@ import contextlib
from distutils import log from distutils import log
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
try: try:
from site import USER_SITE from site import USER_SITE
except ImportError: except ImportError:
...@@ -227,10 +232,6 @@ def download_file_insecure(url, target): ...@@ -227,10 +232,6 @@ def download_file_insecure(url, target):
Use Python to download the file, even though it cannot authenticate the Use Python to download the file, even though it cannot authenticate the
connection. connection.
""" """
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
src = urlopen(url) src = urlopen(url)
try: try:
# Read all the data in one block. # Read all the data in one block.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment