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.
This commit is contained in:
Victor Stinner 2017-11-30 11:40:24 +01:00 committed by GitHub
parent 706e10b186
commit 5e3806f8cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 78 additions and 16 deletions

View file

@ -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()