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 | 13c4cba0e69f11c23a0375175c3a8abf29565b15 (patch) | |
| tree | 562e2107c2dd8c0d83e5c071909fb23d607544e9 /ez_setup.py | |
| parent | 1ca3a09ad16d07cf09655472f0b328b608a8aef8 (diff) | |
| download | python-setuptools-bitbucket-13c4cba0e69f11c23a0375175c3a8abf29565b15.tar.gz | |
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. |
