scripts/dl_github_archive.py: fix python3 transition
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
parent
0851ce4ff9
commit
164037983d
@ -203,7 +203,7 @@ class GitHubCommitTsCache(object):
|
|||||||
ts = ent[0]
|
ts = ent[0]
|
||||||
updated = ent[1]
|
updated = ent[1]
|
||||||
line = '{0} {1} {2}\n'.format(k, ts, updated)
|
line = '{0} {1} {2}\n'.format(k, ts, updated)
|
||||||
fout.write(line)
|
fout.write(line.encode('utf-8'))
|
||||||
|
|
||||||
|
|
||||||
class DownloadGitHubTarball(object):
|
class DownloadGitHubTarball(object):
|
||||||
@ -345,6 +345,7 @@ class DownloadGitHubTarball(object):
|
|||||||
version_is_sha1sum = len(self.version) == 40
|
version_is_sha1sum = len(self.version) == 40
|
||||||
if not version_is_sha1sum:
|
if not version_is_sha1sum:
|
||||||
apis.insert(0, apis.pop())
|
apis.insert(0, apis.pop())
|
||||||
|
reasons = ''
|
||||||
for api in apis:
|
for api in apis:
|
||||||
url = api['url']
|
url = api['url']
|
||||||
attr_path = api['attr_path']
|
attr_path = api['attr_path']
|
||||||
@ -357,9 +358,9 @@ class DownloadGitHubTarball(object):
|
|||||||
self.commit_ts = ct
|
self.commit_ts = ct
|
||||||
self.commit_ts_cache.set(url, ct)
|
self.commit_ts_cache.set(url, ct)
|
||||||
return
|
return
|
||||||
except Exception:
|
except Exception as e:
|
||||||
pass
|
reasons += '\n' + (" {}: {}".format(url, e))
|
||||||
raise self._error('Cannot fetch commit ts: {}'.format(url))
|
raise self._error('Cannot fetch commit ts:{}'.format(reasons))
|
||||||
|
|
||||||
def _init_commit_ts_remote_get(self, url, attrpath):
|
def _init_commit_ts_remote_get(self, url, attrpath):
|
||||||
resp = self._make_request(url)
|
resp = self._make_request(url)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user