diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-09-30 13:55:30 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-09-30 13:55:30 +0200 |
commit | 1904cd9dda6dadf396c1f28031346bdc035d420d (patch) | |
tree | ca0b9c637e5554446b6266b255c9e303407d3d7b /Python/random.c | |
parent | 9a9e274a15370bb90a4856f9dabbc512fe565ce8 (diff) | |
parent | 8d799851fb876c167930eed7d0b23fada08a08d8 (diff) | |
download | cpython-1904cd9dda6dadf396c1f28031346bdc035d420d.tar.gz |
(Merge 3.4) faulthandler: test_gil_released() now uses _sigsegv() instead of
_read_null(), because _read_null() cannot be used on AIX. On AIX, reading from
NULL is allowed: the first page of memory is a mapped read-only on AIX.
_read_null() and _sigabrt() don't accept parameters.
Diffstat (limited to 'Python/random.c')
-rw-r--r-- | Python/random.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Python/random.c b/Python/random.c index 2941ba16af..a052b65725 100644 --- a/Python/random.c +++ b/Python/random.c @@ -15,8 +15,6 @@ static int _Py_HashSecret_Initialized = 0; #endif #ifdef MS_WINDOWS -/* This handle is never explicitly released. Instead, the operating - system will release it when the process terminates. */ static HCRYPTPROV hCryptProv = 0; static int @@ -298,7 +296,12 @@ _PyRandom_Init(void) void _PyRandom_Fini(void) { -#ifndef MS_WINDOWS +#ifdef MS_WINDOWS + if (hCryptProv) { + CryptReleaseContext(hCryptProv, 0); + hCryptProv = 0; + } +#else dev_urandom_close(); #endif } |