Commit 7708fe6d authored by Reinout van Rees's avatar Reinout van Rees

Split a wrongly combined try/except ImportError

The python 2/3 try/except for urlopen() was combined with an optional import
of setuptools and pkg_resources.

The end result is that IF you're on python2 and IF you use
--allow-site-packages and IF you don't have setuptools installed, THEN you'll
get an import error for the python 3 urlopen...
parent 5cd5374d
......@@ -72,12 +72,15 @@ options, args = parser.parse_args()
# load/install setuptools
try:
if options.allow_site_packages:
import setuptools
import pkg_resources
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
if options.allow_site_packages:
try:
import setuptools
import pkg_resources
except ImportError:
pass
ez = {}
if os.path.exists('ez_setup.py'):
......
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