mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
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.
This commit is contained in:
parent
8cc103cb01
commit
2a2a987868
3 changed files with 26 additions and 1 deletions
|
@ -1387,6 +1387,7 @@ dist_patch_DATA = \
|
|||
%D%/packages/patches/python2-parameterized-docstring-test.patch \
|
||||
%D%/packages/patches/python-paste-remove-timing-test.patch \
|
||||
%D%/packages/patches/python-pycrypto-CVE-2013-7459.patch \
|
||||
%D%/packages/patches/python-pycrypto-time-clock.patch \
|
||||
%D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \
|
||||
%D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \
|
||||
%D%/packages/patches/python-robotframework-honor-source-date-epoch.patch \
|
||||
|
|
23
gnu/packages/patches/python-pycrypto-time-clock.patch
Normal file
23
gnu/packages/patches/python-pycrypto-time-clock.patch
Normal file
|
@ -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)))))
|
||||
|
||||
|
|
@ -280,7 +280,8 @@ (define-public python-pycrypto
|
|||
(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"))))
|
||||
|
|
Loading…
Reference in a new issue