diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-17 20:04:40 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-17 20:04:40 -0400 |
commit | aae75a3d3f81aaa8a6bfadb5885b936ec2db59da (patch) | |
tree | b82196333cac56d4bb2dd3514ba9252b5b73cf16 /ez_setup.py | |
parent | 02abac6610d70781ee9be1a1f10377b7b04bfd0a (diff) | |
download | external_python_setuptools-aae75a3d3f81aaa8a6bfadb5885b936ec2db59da.tar.gz external_python_setuptools-aae75a3d3f81aaa8a6bfadb5885b936ec2db59da.tar.bz2 external_python_setuptools-aae75a3d3f81aaa8a6bfadb5885b936ec2db59da.zip |
Move import to the top
Diffstat (limited to 'ez_setup.py')
-rw-r--r-- | ez_setup.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ez_setup.py b/ez_setup.py index a05069b2..4c78d852 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -27,6 +27,11 @@ import contextlib from distutils import log try: + from urllib.request import urlopen +except ImportError: + from urllib2 import urlopen + +try: from site import USER_SITE except ImportError: USER_SITE = None @@ -227,10 +232,6 @@ def download_file_insecure(url, target): Use Python to download the file, even though it cannot authenticate the connection. """ - try: - from urllib.request import urlopen - except ImportError: - from urllib2 import urlopen src = urlopen(url) try: # Read all the data in one block. |