From fe370994991b500b02618457636183868571b765 Mon Sep 17 00:00:00 2001 From: codeskyblue Date: Fri, 20 Mar 2020 19:29:49 +0800 Subject: [PATCH] hotfix upload --- scripts/upload2qiniu.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/upload2qiniu.py b/scripts/upload2qiniu.py index c3331ca..45ce526 100644 --- a/scripts/upload2qiniu.py +++ b/scripts/upload2qiniu.py @@ -22,8 +22,9 @@ def __init__(self, access_key, secret_key, bucket_name: str): def upload_file(self, key, localfile): token = self._auth.upload_token(self._bucket, key) ret, info = put_file(token, key, localfile) - assert ret['key'] == key - assert ret['hash'] == etag(localfile) + if ret: # ret possibly is None + assert ret['key'] == key + assert ret['hash'] == etag(localfile) return info