summaryrefslogtreecommitdiff
path: root/Python/initconfig.c
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na92@gmail.com>2021-08-17 15:52:50 +0000
committerGitHub <noreply@github.com>2021-08-18 00:52:50 +0900
commitc2c857b40f226575d64e0d56a759cbd799f51e62 (patch)
tree892cfca4ed158bdb48e1eefdee6aeaf230ec8911 /Python/initconfig.c
parent96346cb6d0593ef9ec122614347ccb053cd63433 (diff)
downloadcpython-git-c2c857b40f226575d64e0d56a759cbd799f51e62.tar.gz
bpo-44895: Introduce PYTHONDUMPREFSFILE variable for refcount dumping (GH-27767)
Diffstat (limited to 'Python/initconfig.c')
-rw-r--r--Python/initconfig.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/initconfig.c b/Python/initconfig.c
index d328f227ce..61cd0e6213 100644
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -898,6 +898,7 @@ _PyConfig_Copy(PyConfig *config, const PyConfig *config2)
COPY_ATTR(no_debug_ranges);
COPY_ATTR(show_ref_count);
COPY_ATTR(dump_refs);
+ COPY_ATTR(dump_refs_file);
COPY_ATTR(malloc_stats);
COPY_WSTR_ATTR(pycache_prefix);
@@ -1701,6 +1702,14 @@ config_read_env_vars(PyConfig *config)
config->malloc_stats = 1;
}
+ if (config->dump_refs_file == NULL) {
+ status = CONFIG_GET_ENV_DUP(config, &config->dump_refs_file,
+ L"PYTHONDUMPREFSFILE", "PYTHONDUMPREFSFILE");
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
+ }
+
if (config->pythonpath_env == NULL) {
status = CONFIG_GET_ENV_DUP(config, &config->pythonpath_env,
L"PYTHONPATH", "PYTHONPATH");