From 2a2a9878682e4d959633ecab5275397809a1ce3f Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 11 Apr 2020 16:04:26 +0200 Subject: gnu: python-pycrypto: Fix build with Python 3.8. * gnu/packages/patches/python-pycrypto-time-clock.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/python-crypto.scm (python-pycrypto)[source](patches): Add it. --- .../patches/python-pycrypto-time-clock.patch | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 gnu/packages/patches/python-pycrypto-time-clock.patch (limited to 'gnu/packages/patches/python-pycrypto-time-clock.patch') diff --git a/gnu/packages/patches/python-pycrypto-time-clock.patch b/gnu/packages/patches/python-pycrypto-time-clock.patch new file mode 100644 index 0000000000..9b7a8232a2 --- /dev/null +++ b/gnu/packages/patches/python-pycrypto-time-clock.patch @@ -0,0 +1,23 @@ +Drop use of the deprecated time.clock which was removed in Python 3.8. + +Adapted from upstream pull request: + +https://github.com/dlitz/pycrypto/pull/296 + +diff --git a/lib/Crypto/Random/_UserFriendlyRNG.py b/lib/Crypto/Random/_UserFriendlyRNG.py +--- a/lib/Crypto/Random/_UserFriendlyRNG.py ++++ b/lib/Crypto/Random/_UserFriendlyRNG.py +@@ -73,8 +73,11 @@ class _EntropyCollector(object): + t = time.time() + self._time_es.feed(struct.pack("@I", int(2**30 * (t - floor(t))))) + +- # Add the fractional part of time.clock() +- t = time.clock() ++ # Add the fractional part of time.process_time() ++ try: ++ t = time.process_time() ++ except AttributeError: ++ t = time.clock() + self._clock_es.feed(struct.pack("@I", int(2**30 * (t - floor(t))))) + + -- cgit v1.2.3