diff options
author | Conley Owens <cco3@android.com> | 2012-03-12 11:25:04 -0700 |
---|---|---|
committer | Conley Owens <cco3@android.com> | 2012-03-12 12:13:15 -0700 |
commit | 43bda84362b8fd8bb74a81003e8b49cff15ea5ed (patch) | |
tree | 6d7a8606c95c460ef85d4352e86e0aa0f053830e /project.py | |
parent | 9b017dab46bd5b61f8719a3f2d7ca301ea0f6f69 (diff) | |
download | git-repo-43bda84362b8fd8bb74a81003e8b49cff15ea5ed.tar.gz |
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
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1529,7 +1529,7 @@ class Project(object): | |||
1529 | 1529 | ||
1530 | p = None | 1530 | p = None |
1531 | try: | 1531 | try: |
1532 | size = r.headers['content-length'] | 1532 | size = r.headers.get('content-length', 0) |
1533 | unit = 1 << 10 | 1533 | unit = 1 << 10 |
1534 | 1534 | ||
1535 | if size and not quiet: | 1535 | if size and not quiet: |