File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 9
9
10
10
try :
11
11
from select import poll , POLLIN
12
- except ImportError : # Doesn't exist on OSX and other platforms
13
- from select import select
12
+ except ImportError : # `poll` doesn't exist on OSX and other platforms
14
13
poll = False
14
+ try :
15
+ from select import select
16
+ except ImportError : # `select` doesn't exist on AppEngine.
17
+ select = False
15
18
16
19
from .packages import six
17
-
18
20
from .exceptions import LocationParseError
19
21
20
22
@@ -114,6 +116,11 @@ def is_connection_dropped(conn):
114
116
``HTTPConnection`` object.
115
117
"""
116
118
if not poll : # Platform-specific
119
+ if not select : #Platform-specific
120
+ # For environments like AppEngine which handle its own socket reuse, we
121
+ # can assume they will be recycled transparently to us.
122
+ return False
123
+
117
124
return select ([conn .sock ], [], [], 0.0 )[0 ]
118
125
119
126
# This version is better on platforms that support it.
You can’t perform that action at this time.
0 commit comments