diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-10-06 21:11:25 -0400 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-10-06 21:11:25 -0400 |
commit | 9c06648ea3157945a37a3b38e35d71c948b998dd (patch) | |
tree | 6bc2c56520ecad5d30a8b5bbfcc2c05191cfc43f /Python/random.c | |
parent | 1c41575d9be1e2bcce4916ed170fceacf456dd65 (diff) | |
parent | 9d2ec0c84470eb9fdec4fe87cb223a425370e6c3 (diff) | |
download | cpython-9c06648ea3157945a37a3b38e35d71c948b998dd.tar.gz |
merge 3.4
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 } |