Chromium Code Reviews| Index: third_party/upload.py |
| =================================================================== |
| --- third_party/upload.py (revision 71520) |
| +++ third_party/upload.py (working copy) |
| @@ -416,6 +416,15 @@ |
| url = e.info()["location"] |
| else: |
| raise |
| + except urllib2.URLError, e: |
| + if hasattr(e, 'reason'): |
|
M-A Ruel
2011/01/17 18:17:17
you could rewrite as
reason = getattr(e, 'reason',
Ken Russell (switch to Gerrit)
2011/01/18 21:24:10
Done.
|
| + reason = e.reason |
| + if isinstance(reason, str) and reason.find("110") != -1: |
| + # Connection timeout error. |
| + if tries <= 3: |
| + # Try again. |
| + continue |
| + raise |
| finally: |
| socket.setdefaulttimeout(old_timeout) |