guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch core-updates-frozen updated: gnu: python-random2: Fix building wi


From: guix-commits
Subject: branch core-updates-frozen updated: gnu: python-random2: Fix building with python 3.9.
Date: Sat, 11 Sep 2021 08:21:01 -0400

This is an automated email from the git hooks/post-receive script.

glv pushed a commit to branch core-updates-frozen
in repository guix.

The following commit(s) were added to refs/heads/core-updates-frozen by this 
push:
     new 9cfa007  gnu: python-random2: Fix building with python 3.9.
9cfa007 is described below

commit 9cfa0078e6c08d182e09efe4f216ed9b528ec3ad
Author: Guillaume Le Vaillant <glv@posteo.net>
AuthorDate: Sat Sep 11 14:16:46 2021 +0200

    gnu: python-random2: Fix building with python 3.9.
    
    * gnu/packages/patches/python-random2-getrandbits-test.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Add it.
    * gnu/packages/python-xyz.scm (python-random2)[source]: Use it.
---
 gnu/local.mk                                       |  1 +
 .../patches/python-random2-getrandbits-test.patch  | 23 ++++++++++++++++++++++
 gnu/packages/python-xyz.scm                        |  4 +++-
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 07e6787..724ab2f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1548,6 +1548,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch           \
   %D%/packages/patches/pthreadpool-system-libraries.patch      \
   %D%/packages/patches/python-chai-drop-python2.patch          \
+  %D%/packages/patches/python-random2-getrandbits-test.patch           \
   %D%/packages/patches/sdcc-disable-non-free-code.patch                \
   %D%/packages/patches/sdl-pango-api_additions.patch           \
   %D%/packages/patches/sdl-pango-blit_overflow.patch           \
diff --git a/gnu/packages/patches/python-random2-getrandbits-test.patch 
b/gnu/packages/patches/python-random2-getrandbits-test.patch
new file mode 100644
index 0000000..4f6c560
--- /dev/null
+++ b/gnu/packages/patches/python-random2-getrandbits-test.patch
@@ -0,0 +1,23 @@
+From 1bac6355d9c65de847cc445d782c466778b94fbd Mon Sep 17 00:00:00 2001
+From: "Robert T. McGibbon" <rmcgibbo@gmail.com>
+Date: Sun, 9 May 2021 11:18:23 -0400
+Subject: [PATCH] Update tests for python3.9
+
+---
+ src/tests.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/tests.py b/src/tests.py
+index d918891..4f2c3de 100644
+--- a/src/tests.py
++++ b/src/tests.py
+@@ -448,7 +448,8 @@ def test_genrandbits(self):
+         self.assertRaises(TypeError, self.gen.getrandbits)
+         self.assertRaises(TypeError, self.gen.getrandbits, 'a')
+         self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)
+-        self.assertRaises(ValueError, self.gen.getrandbits, 0)
++        if sys.version_info < (3, 9):
++            self.assertRaises(ValueError, self.gen.getrandbits, 0)
+         self.assertRaises(ValueError, self.gen.getrandbits, -1)
+ 
+     def test_randbelow_logic(self, _log=log, int=int):
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f888821..88609fb 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16179,7 +16179,9 @@ focus on building massively scalable web applications.")
               (uri (pypi-uri "random2" version ".zip"))
               (sha256
                (base32
-                "01y0s4747plsx8fdnxy0nz83dp69naddz58m81r9h0s1qfm31b9l"))))
+                "01y0s4747plsx8fdnxy0nz83dp69naddz58m81r9h0s1qfm31b9l"))
+              (patches
+               (search-patches "python-random2-getrandbits-test.patch"))))
     (build-system python-build-system)
     (native-inputs `(("unzip" ,unzip)))
     (home-page "http://pypi.python.org/pypi/random2";)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]