From 1abcf6700b4da6207fe859de40c6c1bada6b4fec Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Tue, 23 May 2017 21:46:51 -0700 Subject: bpo-22257: Private C-API for core runtime initialization (PEP 432). (#1772) (patch by Nick Coghlan) --- Python/bootstrap_hash.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Python/bootstrap_hash.c') 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); } -- cgit v1.2.1