aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/patches/python-pycrypto-time-clock.patch23
-rw-r--r--gnu/packages/python-crypto.scm3
2 files changed, 25 insertions, 1 deletions
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)))))
+
+
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index 80160301dd..eb57f2bbd9 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -280,7 +280,8 @@ making them easy to handle and incorporate into other protocols.")
(origin
(method url-fetch)
(uri (pypi-uri "pycrypto" version))
- (patches (search-patches "python-pycrypto-CVE-2013-7459.patch"))
+ (patches (search-patches "python-pycrypto-CVE-2013-7459.patch"
+ "python-pycrypto-time-clock.patch"))
(sha256
(base32
"0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"))))