mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
706e10b186
commit
5e3806f8cf
10 changed files with 78 additions and 16 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue