E603 BaseSelectorEventLoop uses directly the private _debug attribute · python/asyncio@d3dbdf8 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit d3dbdf8

Browse files
committed
BaseSelectorEventLoop uses directly the private _debug attribute
Just try to be consistent: _debug was already used in some places, and always used in BaseProactorEventLoop.
1 parent b9d3799 commit d3dbdf8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

asyncio/selector_events.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def _accept_connection2(self, protocol_factory, conn, extra,
214214

215215
# It's now up to the protocol to handle the connection.
216216
except Exception as exc:
217-
if self.get_debug():
217+
if self._debug:
218218
context = {
219219
'message': ('Error on transport creation '
220220
'for incoming connection'),
@@ -312,7 +312,7 @@ def sock_recv(self, sock, n):
312312
313313
This method is a coroutine.
314314
"""
315-
if self.get_debug() and sock.gettimeout() != 0:
315+
if self._debug and sock.gettimeout() != 0:
316316
raise ValueError("the socket must be non-blocking")
317317
fut = futures.Future(loop=self)
318318
self._sock_recv(fut, False, sock, n)
@@ -350,7 +350,7 @@ def sock_sendall(self, sock, data):
350350
351351
This method is a coroutine.
352352
"""
353-
if self.get_debug() and sock.gettimeout() != 0:
353+
if self._debug and sock.gettimeout() != 0:
354354
raise ValueError("the socket must be non-blocking")
355355
fut = futures.Future(loop=self)
356356
if data:
@@ -393,7 +393,7 @@ def sock_connect(self, sock, address):
393393
394394
This method is a coroutine.
395395
"""
396-
if self.get_debug() and sock.gettimeout() != 0:
396+
if self._debug and sock.gettimeout() != 0:
397397
raise ValueError("the socket must be non-blocking")
398398
fut = futures.Future(loop=self)
399399
try:
@@ -453,7 +453,7 @@ def sock_accept(self, sock):
453453
454454
This method is a coroutine.
455455
"""
456-
if self.get_debug() and sock.gettimeout() != 0:
456+
if self._debug and sock.gettimeout() != 0:
457457
raise ValueError("the socket must be non-blocking")
458458
fut = futures.Future(loop=self)
459459
self._sock_accept(fut, False, sock)

0 commit comments

Comments
 (0)
0