diff options
author | Ryan Barrett <git@ryanb.org> | 2014-02-12 22:50:38 -0800 |
---|---|---|
committer | Ryan Barrett <git@ryanb.org> | 2014-02-12 22:50:38 -0800 |
commit | 9e1c4e5e56009e4c08ff446b30ec3f6b55fd4a03 (patch) | |
tree | d6f4c6045e85a95145b29e9e8d17f4bbb0c2f459 | |
parent | 3118243f371f56ba5b6cf9d7dfcea09c98daa573 (diff) | |
download | httplib2-9e1c4e5e56009e4c08ff446b30ec3f6b55fd4a03.tar.gz |
use socket.getdefaulttimeout() on App Engine as well as off, take 2
the first attempt (3118243f371f56ba5b6cf9d7dfcea09c98daa573) wouldn't set the timeout for clients that passed deadline=None explicitly, which App Engine's httplib often does. this fixes that.
-rw-r--r-- | python2/httplib2/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py index b558374..8825e5d 100644 --- a/python2/httplib2/__init__.py +++ b/python2/httplib2/__init__.py @@ -1082,7 +1082,9 @@ try: def _new_fixed_fetch(validate_certificate): def fixed_fetch(url, payload=None, method="GET", headers={}, allow_truncated=False, follow_redirects=True, - deadline=socket.getdefaulttimeout() or 5): + deadline=None): + if deadline is None: + deadline = socket.getdefaulttimeout() or 5 return fetch(url, payload=payload, method=method, headers=headers, allow_truncated=allow_truncated, follow_redirects=follow_redirects, deadline=deadline, |