Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66db06d

Browse files
committed
Run make pull_chunked and make sync_chunked.
This makes us compatible with Python < 2.7.9 again.
1 parent ff7a57d commit 66db06d

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

plotly/plotly/chunked_requests/chunked_request.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
from six.moves import http_client
55
from six.moves.urllib.parse import urlparse
6-
from ssl import SSLWantReadError
6+
from ssl import SSLError
77

88

99
class Stream:
@@ -254,13 +254,16 @@ def _isconnected(self):
254254
# let's just assume that we're still connected and
255255
# hopefully recieve some data on the next try.
256256
return True
257-
elif isinstance(e, SSLWantReadError):
258-
# From: https://docs.python.org/3/library/ssl.html
259-
# This is raised when trying to read or write data, but more
260-
# data needs to be received on the underlying TCP transport
261-
# before the request can be fulfilled. The socket is still
262-
# connected to the server in this case.
263-
return True
257+
elif isinstance(e, SSLError):
258+
if e.errno == 2:
259+
# errno 2 occurs when trying to read or write data, but more
260+
# data needs to be received on the underlying TCP transport
261+
# before the request can be fulfilled.
262+
#
263+
# Python 2.7.9+ and Python 3.3+ give this its own exception,
264+
# SSLWantReadError
265+
return True
266+
raise e
264267
else:
265268
# Unknown scenario
266269
raise e

submodules/chunked_requests

0 commit comments

Comments
 (0)