aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2019-08-19 13:39:18 +0000
committerYousong Zhou <yszhou4tech@gmail.com>2019-08-20 13:34:58 +0000
commit164037983d00cc5b27f970b40c4a697d31277164 (patch)
treeb1f0c37dd917961505dab0ae8bbc4c97647ebe47 /scripts
parent0851ce4ff97260a0fab2a507ee8370e60f78370d (diff)
downloadupstream-164037983d00cc5b27f970b40c4a697d31277164.tar.gz
upstream-164037983d00cc5b27f970b40c4a697d31277164.tar.bz2
upstream-164037983d00cc5b27f970b40c4a697d31277164.zip
scripts/dl_github_archive.py: fix python3 transition
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dl_github_archive.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/dl_github_archive.py b/scripts/dl_github_archive.py
index 671a7acfac..1e91e28998 100755
--- a/scripts/dl_github_archive.py
+++ b/scripts/dl_github_archive.py
@@ -203,7 +203,7 @@ class GitHubCommitTsCache(object):
ts = ent[0]
updated = ent[1]
line = '{0} {1} {2}\n'.format(k, ts, updated)
- fout.write(line)
+ fout.write(line.encode('utf-8'))
class DownloadGitHubTarball(object):
@@ -345,6 +345,7 @@ class DownloadGitHubTarball(object):
version_is_sha1sum = len(self.version) == 40
if not version_is_sha1sum:
apis.insert(0, apis.pop())
+ reasons = ''
for api in apis:
url = api['url']
attr_path = api['attr_path']
@@ -357,9 +358,9 @@ class DownloadGitHubTarball(object):
self.commit_ts = ct
self.commit_ts_cache.set(url, ct)
return
- except Exception:
- pass
- raise self._error('Cannot fetch commit ts: {}'.format(url))
+ except Exception as e:
+ reasons += '\n' + (" {}: {}".format(url, e))
+ raise self._error('Cannot fetch commit ts:{}'.format(reasons))
def _init_commit_ts_remote_get(self, url, attrpath):
resp = self._make_request(url)