]> granicus.if.org Git - python/commitdiff
asyncio: BaseSelectorEventLoop uses directly the private _debug attribute
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 4 Feb 2015 13:50:59 +0000 (14:50 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 4 Feb 2015 13:50:59 +0000 (14:50 +0100)
Just try to be consistent: _debug was already used in some places, and always
used in BaseProactorEventLoop.

Lib/asyncio/selector_events.py

index 4bd6dc8d1cbf78b3d125708184e17bccc1727370..7cbd4fd108d3056fc0e961c1088bc0cc3c2f0154 100644 (file)
@@ -214,7 +214,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
 
             # It's now up to the protocol to handle the connection.
         except Exception as exc:
-            if self.get_debug():
+            if self._debug:
                 context = {
                     'message': ('Error on transport creation '
                                 'for incoming connection'),
@@ -312,7 +312,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
 
         This method is a coroutine.
         """
-        if self.get_debug() and sock.gettimeout() != 0:
+        if self._debug and sock.gettimeout() != 0:
             raise ValueError("the socket must be non-blocking")
         fut = futures.Future(loop=self)
         self._sock_recv(fut, False, sock, n)
@@ -350,7 +350,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
 
         This method is a coroutine.
         """
-        if self.get_debug() and sock.gettimeout() != 0:
+        if self._debug and sock.gettimeout() != 0:
             raise ValueError("the socket must be non-blocking")
         fut = futures.Future(loop=self)
         if data:
@@ -393,7 +393,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
 
         This method is a coroutine.
         """
-        if self.get_debug() and sock.gettimeout() != 0:
+        if self._debug and sock.gettimeout() != 0:
             raise ValueError("the socket must be non-blocking")
         fut = futures.Future(loop=self)
         try:
@@ -453,7 +453,7 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
 
         This method is a coroutine.
         """
-        if self.get_debug() and sock.gettimeout() != 0:
+        if self._debug and sock.gettimeout() != 0:
             raise ValueError("the socket must be non-blocking")
         fut = futures.Future(loop=self)
         self._sock_accept(fut, False, sock)