mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Avoid missing content-length header in project.py
Occassionally, the content-length may be missing when using urlib in python 2.6 and 2.7. This change assumes the value of the header is 0 if it doesn't exist Change-Id: Iaf1c8a796bc667823d4d7c30f9b617644b271d00
This commit is contained in:
parent
9b017dab46
commit
43bda84362
@ -1529,7 +1529,7 @@ class Project(object):
|
|||||||
|
|
||||||
p = None
|
p = None
|
||||||
try:
|
try:
|
||||||
size = r.headers['content-length']
|
size = r.headers.get('content-length', 0)
|
||||||
unit = 1 << 10
|
unit = 1 << 10
|
||||||
|
|
||||||
if size and not quiet:
|
if size and not quiet:
|
||||||
|
Loading…
Reference in New Issue
Block a user