mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
asyncio, Tulip issue #136: Add get/set_debug() methods to BaseEventLoopTests.
Add also a PYTHONASYNCIODEBUG environment variable to debug coroutines since Python startup, to be able to debug coroutines defined directly in the asyncio module.
This commit is contained in:
parent
f4558e8b54
commit
7ef60cd8c2
8 changed files with 83 additions and 5 deletions
|
@ -123,6 +123,7 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
self._running = False
|
||||
self._clock_resolution = time.get_clock_info('monotonic').resolution
|
||||
self._exception_handler = None
|
||||
self._debug = False
|
||||
|
||||
def _make_socket_transport(self, sock, protocol, waiter=None, *,
|
||||
extra=None, server=None):
|
||||
|
@ -795,3 +796,9 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
if not handle._cancelled:
|
||||
handle._run()
|
||||
handle = None # Needed to break cycles when an exception occurs.
|
||||
|
||||
def get_debug(self):
|
||||
return self._debug
|
||||
|
||||
def set_debug(self, enabled):
|
||||
self._debug = enabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue