summaryrefslogtreecommitdiff
path: root/Python/random.c
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-05-22 15:29:18 -0700
committerNed Deily <nad@acm.org>2014-05-22 15:29:18 -0700
commitfcc387425dca970e54cddabb539b54849e7137fc (patch)
treedb8e1f7aef6b4cd5a17892c5f1aa7d916e9e61b0 /Python/random.c
parent02256dcd881900c4b22140aaf8f3a17a17319bd0 (diff)
parent6248652cd68fb12e060c9ec640e74c15be10af8f (diff)
downloadcpython-fcc387425dca970e54cddabb539b54849e7137fc.tar.gz
Issue #21383: OS X installer builds now use "make touch".
Diffstat (limited to 'Python/random.c')
-rw-r--r--Python/random.c9
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
}