asyncio: Enable the debug mode of event loops when the PYTHONASYNCIODEBUG
environment variable is set
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 @@
         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