summaryrefslogtreecommitdiff
path: root/Python/bootstrap_hash.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2017-05-23 21:46:51 -0700
committerGitHub <noreply@github.com>2017-05-23 21:46:51 -0700
commit1abcf6700b4da6207fe859de40c6c1bada6b4fec (patch)
tree9257126657803f00035c44cb0d1ae579a78ce999 /Python/bootstrap_hash.c
parentc842efc6aedf979b827a9473192f46cec53d58db (diff)
downloadcpython-git-1abcf6700b4da6207fe859de40c6c1bada6b4fec.tar.gz
bpo-22257: Private C-API for core runtime initialization (PEP 432). (#1772)
(patch by Nick Coghlan)
Diffstat (limited to 'Python/bootstrap_hash.c')
-rw-r--r--Python/bootstrap_hash.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c
index 27d26ead05..807d6023ce 100644
--- a/Python/bootstrap_hash.c
+++ b/Python/bootstrap_hash.c
@@ -599,11 +599,11 @@ init_hash_secret(int use_hash_seed,
}
void
-_Py_HashRandomization_Init(void)
+_Py_HashRandomization_Init(_PyCoreConfig *core_config)
{
char *seed_text;
- int use_hash_seed = -1;
- unsigned long hash_seed;
+ int use_hash_seed = core_config->use_hash_seed;
+ unsigned long hash_seed = core_config->hash_seed;
if (use_hash_seed < 0) {
seed_text = Py_GETENV("PYTHONHASHSEED");
@@ -611,6 +611,8 @@ _Py_HashRandomization_Init(void)
Py_FatalError("PYTHONHASHSEED must be \"random\" or an integer "
"in range [0; 4294967295]");
}
+ core_config->use_hash_seed = use_hash_seed;
+ core_config->hash_seed = hash_seed;
}
init_hash_secret(use_hash_seed, hash_seed);
}