aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-04-17 19:05:35 +0200
committerGitHub <noreply@github.com>2020-04-17 19:05:35 +0200
commit9f5fe7910f4a1bf5a425837d4915e332b945eb7b (patch)
tree5f652699332e33a81cf6baa5ff5b6fecadea1903 /setup.py
parentbpo-39901: Move `pathlib.Path.owner()` and `group()` implementations into the... (diff)
downloadcpython-9f5fe7910f4a1bf5a425837d4915e332b945eb7b.tar.gz
cpython-9f5fe7910f4a1bf5a425837d4915e332b945eb7b.tar.bz2
cpython-9f5fe7910f4a1bf5a425837d4915e332b945eb7b.zip
bpo-40286: Add randbytes() method to random.Random (GH-19527)
Add random.randbytes() function and random.Random.randbytes() method to generate random bytes. Modify secrets.token_bytes() to use SystemRandom.randbytes() rather than calling directly os.urandom(). Rename also genrand_int32() to genrand_uint32(), since it returns an unsigned 32-bit integer, not a signed integer. The _random module is now built with Py_BUILD_CORE_MODULE defined.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 65a1cfab078..d241dc0b4b4 100644
--- a/setup.py
+++ b/setup.py
@@ -808,7 +808,8 @@ class PyBuildExt(build_ext):
self.add(Extension('_datetime', ['_datetimemodule.c'],
libraries=['m']))
# random number generator implemented in C
- self.add(Extension("_random", ["_randommodule.c"]))
+ self.add(Extension("_random", ["_randommodule.c"],
+ extra_compile_args=['-DPy_BUILD_CORE_MODULE']))
# bisect
self.add(Extension("_bisect", ["_bisectmodule.c"]))
# heapq