Skip to content

Commit

Permalink
Fix imports for BUILDGROMACS.
Browse files Browse the repository at this point in the history
When building a GROMACS for internal use, such as for readthedocs,
import urlopen correctly and explicitly react to ImportError for
different Python versions.

[ci skip]
  • Loading branch information
eirrgang committed Jul 27, 2018
1 parent ab4f964 commit 09a72ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ def get_gromacs(url, cmake_args=(), build_args=()):
warn("get_gromacs needs ssl support, but `import ssl` fails")
raise
try:
import urllib.request.urlopen as urlopen
except:
from urllib.request import urlopen
except ImportError:
try:
import urllib2.urlopen as urlopen
except:
from urllib2 import urlopen
except ImportError:
raise RuntimeError("Need urllib or urllib2 package to download GROMACS.")
import tempfile
# import tarfile
Expand Down

0 comments on commit 09a72ac

Please sign in to comment.