diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-19 22:15:02 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-19 22:15:02 (GMT) |
commit | 0f3e6bca1b7478027843fe6181f6b12f4c1514ed (patch) | |
tree | 0f997927e36175ab273d42bb947d4eee8001fc46 /Lib/asyncio/base_events.py | |
parent | ff385b89f40cfdfb6ceab41acfa89fa8594318f6 (diff) | |
download | cpython-0f3e6bca1b7478027843fe6181f6b12f4c1514ed.zip cpython-0f3e6bca1b7478027843fe6181f6b12f4c1514ed.tar.gz cpython-0f3e6bca1b7478027843fe6181f6b12f4c1514ed.tar.bz2 |
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.
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r-- | Lib/asyncio/base_events.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index b94ba07..69caa4d 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -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 |