Skip to content

Commit 9e1c4e5

Browse files
committed
use socket.getdefaulttimeout() on App Engine as well as off, take 2
the first attempt (3118243) wouldn't set the timeout for clients that passed deadline=None explicitly, which App Engine's httplib often does. this fixes that.
1 parent 3118243 commit 9e1c4e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python2/httplib2/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,9 @@ def connect(self):
10821082
def _new_fixed_fetch(validate_certificate):
10831083
def fixed_fetch(url, payload=None, method="GET", headers={},
10841084
allow_truncated=False, follow_redirects=True,
1085-
deadline=socket.getdefaulttimeout() or 5):
1085+
deadline=None):
1086+
if deadline is None:
1087+
deadline = socket.getdefaulttimeout() or 5
10861088
return fetch(url, payload=payload, method=method, headers=headers,
10871089
allow_truncated=allow_truncated,
10881090
follow_redirects=follow_redirects, deadline=deadline,

0 commit comments

Comments
 (0)