Skip to content

Commit a6a714e

Browse files
backup download server
1 parent b88dca0 commit a6a714e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

smodels/lib/pythia8/installer.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def rmTarball():
2323
os.unlink ( tarball )
2424

2525
def fetch():
26-
""" fetch tarball from pythia.org """
26+
""" fetch tarball from pythia.org or smodels.github.io """
2727
ver = getVersion()
2828
tarball=f"pythia{ver}.tgz"
2929
if os.path.exists ( tarball ):
@@ -43,7 +43,14 @@ def fetch():
4343
if r.status_code != 200:
4444
print ( f"[installer.py] could not fetch tarball: {r.reason}." )
4545
rmTarball()
46-
sys.exit(-1)
46+
url=f"http://smodels.github.io/downloads/tarballs/"
47+
print ( f"[installer.py] trying to fetch {tarball} from {url}" )
48+
path = os.path.join ( url, tarball )
49+
r = requests.get ( path, stream=True )
50+
if r.status_code != 200:
51+
print ( f"[installer.py] could not fetch tarball: {r.reason}." )
52+
rmTarball()
53+
sys.exit(-1)
4754
with open ( tarball, "wb" ) as f:
4855
shutil.copyfileobj( r.raw, f )
4956
f.close()

0 commit comments

Comments
 (0)