diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-30 10:40:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-30 10:40:24 (GMT) |
commit | 5e3806f8cfd84722fc55d4299dc018ad9b0f8401 (patch) | |
tree | 436f0a963001f590a1193dba5c84627ba59513c2 /Lib/asyncio | |
parent | 706e10b186992e086e661a62d2c8ec9588525b31 (diff) | |
download | cpython-5e3806f8cfd84722fc55d4299dc018ad9b0f8401.zip cpython-5e3806f8cfd84722fc55d4299dc018ad9b0f8401.tar.gz cpython-5e3806f8cfd84722fc55d4299dc018ad9b0f8401.tar.bz2 |
bpo-32101: Add PYTHONDEVMODE environment variable (#4624)
* bpo-32101: Add sys.flags.dev_mode flag
Rename also the "Developer mode" to the "Development mode".
* bpo-32101: Add PYTHONDEVMODE environment variable
Mention it in the development chapiter.
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/coroutines.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/asyncio/coroutines.py b/Lib/asyncio/coroutines.py index b6f81a4..7d2ca05 100644 --- a/Lib/asyncio/coroutines.py +++ b/Lib/asyncio/coroutines.py @@ -27,11 +27,9 @@ def _is_debug_mode(): # before you define your coroutines. A downside of using this feature # is that tracebacks show entries for the CoroWrapper.__next__ method # when _DEBUG is true. - debug = (not sys.flags.ignore_environment and - bool(os.environ.get('PYTHONASYNCIODEBUG'))) - if hasattr(sys, '_xoptions') and 'dev' in sys._xoptions: - debug = True - return debug + return (sys.flags.dev_mode + or (not sys.flags.ignore_environment + and bool(os.environ.get('PYTHONASYNCIODEBUG')))) _DEBUG = _is_debug_mode() |