diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-06-22 22:12:14 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-06-22 22:12:14 (GMT) |
commit | 7b7120e159e2cb951b01773a164426c9e0bffa2d (patch) | |
tree | 39eaab2c2bdc14b365b734a17baf2ddb1f414627 /Lib/asyncio/base_events.py | |
parent | d6de5d8455ac0d120d9c49d04f350433a86ec4e6 (diff) | |
download | cpython-7b7120e159e2cb951b01773a164426c9e0bffa2d.zip cpython-7b7120e159e2cb951b01773a164426c9e0bffa2d.tar.gz cpython-7b7120e159e2cb951b01773a164426c9e0bffa2d.tar.bz2 |
asyncio: Enable the debug mode of event loops when the PYTHONASYNCIODEBUG
environment variable is set
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r-- | Lib/asyncio/base_events.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 2227a26..0975bcb 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -137,7 +137,8 @@ class BaseEventLoop(events.AbstractEventLoop): self._running = False self._clock_resolution = time.get_clock_info('monotonic').resolution self._exception_handler = None - self._debug = False + self._debug = (not sys.flags.ignore_environment + and bool(os.environ.get('PYTHONASYNCIODEBUG'))) # In debug mode, if the execution of a callback or a step of a task # exceed this duration in seconds, the slow callback/task is logged. self.slow_callback_duration = 0.1 |