Skip to content

Instantly share code, notes, and snippets.

@orip
Created November 23, 2020 11:22
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save orip/00142a498cf6d0c536b5d38771ad6249 to your computer and use it in GitHub Desktop.
Save orip/00142a498cf6d0c536b5d38771ad6249 to your computer and use it in GitHub Desktop.
Patch for Python 3.4.x for macos, based on https://bugs.python.org/issue28676
diff --git a/Python/random.c b/Python/random.c
index 93d300d..396041d 100644
--- a/Python/random.c
+++ b/Python/random.c
@@ -3,6 +3,9 @@
#include <windows.h>
#else
#include <fcntl.h>
+#if defined(HAVE_GETRANDOM) || defined(HAVE_GETENTROPY)
+#include <sys/random.h>
+#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
@huwaizatahir2
Copy link

@DuncanTormey your solution was only one that worked for me too.... thank you sooooo much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment