Skip to content

Commit e6a4c8f

Browse files
committed
Black
1 parent 6d7a44a commit e6a4c8f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

adafruit_requests.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,21 @@ def __init__(self, response):
6161
def read(self, size=-1):
6262
"""Read as much as available or up to size and return it in a byte string.
6363
64-
Do NOT use this unless you really need to. Reusing memory with `readinto` is much better.
65-
"""
64+
Do NOT use this unless you really need to. Reusing memory with `readinto` is much better.
65+
"""
6666
if size == -1:
6767
return self._response.content
6868
return self._response.socket.recv(size)
6969

7070
def readinto(self, buf):
7171
"""Read as much as available into buf or until it is full. Returns the number of bytes read
72-
into buf."""
73-
return self._response._readinto(buf) # pylint: disable=protected-access
72+
into buf."""
73+
return self._response._readinto(buf) # pylint: disable=protected-access
7474

7575

7676
class Response:
7777
"""The response from a request, contains all the headers/content"""
78+
7879
# pylint: disable=too-many-instance-attributes
7980

8081
encoding = None
@@ -242,7 +243,7 @@ def close(self):
242243
self._throw_away(chunk_size + 2)
243244
self._parse_headers()
244245
if self._session:
245-
self._session._free_socket(self.socket) # pylint: disable=protected-access
246+
self._session._free_socket(self.socket) # pylint: disable=protected-access
246247
else:
247248
self.socket.close()
248249
self.socket = None
@@ -344,6 +345,7 @@ def iter_content(self, chunk_size=1, decode_unicode=False):
344345

345346
class Session:
346347
"""HTTP session that shares sockets and ssl context."""
348+
347349
def __init__(self, socket_pool, ssl_context=None):
348350
self._socket_pool = socket_pool
349351
self._ssl_context = ssl_context
@@ -521,7 +523,7 @@ def delete(self, url, **kw):
521523

522524
# Backwards compatible API:
523525

524-
_default_session = None # pylint: disable=invalid-name
526+
_default_session = None # pylint: disable=invalid-name
525527

526528

527529
class _FakeSSLContext:
@@ -534,7 +536,7 @@ def wrap_socket(socket, server_hostname=None):
534536

535537
def set_socket(sock, iface=None):
536538
"""Legacy API for setting the socket and network interface. Use a `Session` instead."""
537-
global _default_session # pylint: disable=global-statement,invalid-name
539+
global _default_session # pylint: disable=global-statement,invalid-name
538540
_default_session = Session(sock, _FakeSSLContext())
539541
if iface:
540542
sock.set_interface(iface)

0 commit comments

Comments
 (0)