Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c51d244

Browse files
committed
Issue #25171: Fix compilation issue on OpenBSD in random.c
Patch written by Remi Pointel.
1 parent d69dd8b commit c51d244

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Python/random.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ _PyOS_URandom(void *buffer, Py_ssize_t size)
364364

365365
#ifdef MS_WINDOWS
366366
return win32_urandom((unsigned char *)buffer, size, 1);
367-
#elif PY_GETENTROPY
367+
#elif defined(PY_GETENTROPY)
368368
return py_getentropy(buffer, size, 0);
369369
#else
370370
return dev_urandom_python((char*)buffer, size);
@@ -411,7 +411,7 @@ _PyRandom_Init(void)
411411
else {
412412
#ifdef MS_WINDOWS
413413
(void)win32_urandom(secret, secret_size, 0);
414-
#elif PY_GETENTROPY
414+
#elif defined(PY_GETENTROPY)
415415
(void)py_getentropy(secret, secret_size, 1);
416416
#else
417417
dev_urandom_noraise(secret, secret_size);
@@ -427,7 +427,7 @@ _PyRandom_Fini(void)
427427
CryptReleaseContext(hCryptProv, 0);
428428
hCryptProv = 0;
429429
}
430-
#elif PY_GETENTROPY
430+
#elif defined(PY_GETENTROPY)
431431
/* nothing to clean */
432432
#else
433433
dev_urandom_close();

0 commit comments

Comments
 (0)