Skip to content

Commit

Permalink
Merge pull request youtube#18 from ttruong21/master
Browse files Browse the repository at this point in the history
fix chunk upload - TypeError: argument of type 'NoneType' is not iterable
  • Loading branch information
ulukaya committed Jun 10, 2015
2 parents 75bdfa4 + 60b1bca commit a08ca32
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/upload_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ def resumable_upload(insert_request):
try:
print "Uploading file..."
status, response = insert_request.next_chunk()
if 'id' in response:
print "Video id '%s' was successfully uploaded." % response['id']
else:
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:
exit("The upload failed with an unexpected response: %s" % response)
except HttpError, e:
if e.resp.status in RETRIABLE_STATUS_CODES:
error = "A retriable HTTP error %d occurred:\n%s" % (e.resp.status,
Expand Down

0 comments on commit a08ca32

Please sign in to comment.