We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 75bdfa4 + 60b1bca commit a08ca32Copy full SHA for a08ca32
1 file changed
python/upload_video.py
@@ -132,10 +132,11 @@ def resumable_upload(insert_request):
132
try:
133
print "Uploading file..."
134
status, response = insert_request.next_chunk()
135
- if 'id' in response:
136
- print "Video id '%s' was successfully uploaded." % response['id']
137
- else:
138
- exit("The upload failed with an unexpected response: %s" % response)
+ if response is not None:
+ if 'id' in response:
+ print "Video id '%s' was successfully uploaded." % response['id']
+ else:
139
+ exit("The upload failed with an unexpected response: %s" % response)
140
except HttpError, e:
141
if e.resp.status in RETRIABLE_STATUS_CODES:
142
error = "A retriable HTTP error %d occurred:\n%s" % (e.resp.status,
0 commit comments