diff --git a/Python/random.c b/Python/random.c index f9d600f22fe..0f945a3d011 100644 --- a/Python/random.c +++ b/Python/random.c @@ -12,7 +12,7 @@ # ifdef HAVE_LINUX_RANDOM_H # include # endif -# ifdef HAVE_SYS_RANDOM_H +# if defined(HAVE_SYS_RANDOM_H) && (defined(HAVE_GETRANDOM) || defined(HAVE_GETENTROPY)) # include # endif # if !defined(HAVE_GETRANDOM) && defined(HAVE_GETRANDOM_SYSCALL)