Skip to content

Commit c332bd9

Browse files
author
tychoish
committed
giza: make intersphinx downloads a bit less strict
1 parent dea18f0 commit c332bd9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

giza/giza/content/intersphinx.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737

3838

3939
def download_file(file, url):
40-
safe_create_directory(os.path.dirname(file))
41-
4240
cmd = ['curl', '-s', '--remote-time', url, '-o', file]
4341

42+
safe_create_directory(os.path.dirname(f))
43+
4444
try:
4545
subprocess.check_call(cmd)
4646
logger.info('downloaded {0}'.format(file))
@@ -59,12 +59,18 @@ def file_timestamp(path):
5959
def download(f, s, conf):
6060
if conf.runstate.force is True:
6161
newf = download_file(f, s)
62+
6263
if os.path.isfile(f):
6364
newf = False
6465
else:
6566
logger.info('{0} file does not exist, downloading now'.format(f))
6667
newf = download_file(f, s)
6768

69+
if newf is False:
70+
m = "intersphinx inventory ({0}) download failed. skipping"
71+
logger.warning(m.format(f))
72+
return
73+
6874
mtime = file_timestamp(f)
6975

7076
if mtime < time.time() - ACCEPTABLE:

0 commit comments

Comments
 (0)