-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-32101: Add PYTHONDEVMODE environment variable #4624
Conversation
Oh, test_sys fails in development mode, but it's unrelated to this PR: bug fixed by PR #4625. Another bug: test_faulthandler and test_asyncio now fail with PYTHONDEVMODE=1. |
Rename also the "Developer mode" to the "Development mode".
Mention it in the development chapiter.
I rebased my change to get the memory allocator fixes (commit 5d39e04), and I documented the "Python development mode" in the Development chapiter of the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'm OK with the idea of committing to dev mode being an "all or nothing" toggle - the more fine-grained control already exists in the form of the underlying settings that dev mode groups together.
Lib/asyncio/coroutines.py
Outdated
@@ -31,7 +31,7 @@ def _is_debug_mode(): | |||
# 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: | |||
if sys.flags.dev_mode: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the second check is shorter, this could be simplified to:
debug = sys.flags.dev_mode or (not sys.flags.ignore_environment and
bool(os.environ.get('PYTHONASYNCIODEBUG'))
return debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Add also the sys.flags.dev_mode flag.
https://bugs.python.org/issue32101