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