summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-30 10:40:24 (GMT)
committerGitHub <noreply@github.com>2017-11-30 10:40:24 (GMT)
commit5e3806f8cfd84722fc55d4299dc018ad9b0f8401 (patch)
tree436f0a963001f590a1193dba5c84627ba59513c2 /Modules
parent706e10b186992e086e661a62d2c8ec9588525b31 (diff)
downloadcpython-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 'Modules')
-rw-r--r--Modules/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/main.c b/Modules/main.c
index ec33b5f..e9d524a 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -124,7 +124,8 @@ static const char usage_6[] =
" hooks.\n"
"PYTHONCOERCECLOCALE: if this variable is set to 0, it disables the locale\n"
" coercion behavior. Use PYTHONCOERCECLOCALE=warn to request display of\n"
-" locale coercion and locale compatibility warnings on stderr.\n";
+" locale coercion and locale compatibility warnings on stderr.\n"
+"PYTHONDEVMODE: enable the development mode.\n";
static void
pymain_usage(int error, const wchar_t* program)
@@ -1520,7 +1521,9 @@ pymain_parse_envvars(_PyMain *pymain)
if (pymain_init_tracemalloc(pymain) < 0) {
return -1;
}
- if (pymain_get_xoption(pymain, L"dev")) {
+ if (pymain_get_xoption(pymain, L"dev" ) ||
+ pymain_get_env_var("PYTHONDEVMODE"))
+ {
core_config->dev_mode = 1;
core_config->faulthandler = 1;
core_config->allocator = "debug";