diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2014-06-22 22:14:45 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2014-06-22 22:14:45 (GMT) |
| commit | d42b49256fa02397e606410cdf17f450dbf0f206 (patch) | |
| tree | ed78a4f16e381b975aa51d9e6d3b30578111cbdb /Lib/asyncio | |
| parent | 33d2e40d887967968897eda3d8b7a0c98853bf3d (diff) | |
| parent | 7b7120e159e2cb951b01773a164426c9e0bffa2d (diff) | |
| download | cpython-d42b49256fa02397e606410cdf17f450dbf0f206.zip cpython-d42b49256fa02397e606410cdf17f450dbf0f206.tar.gz cpython-d42b49256fa02397e606410cdf17f450dbf0f206.tar.bz2 | |
(Merge 3.4) asyncio: Enable the debug mode of event loops when the
PYTHONASYNCIODEBUG environment variable is set
Diffstat (limited to 'Lib/asyncio')
| -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 |
