summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/random2/files/random2-1.0.1-py39-tests.patch32
-rw-r--r--dev-python/random2/random2-1.0.1-r1.ebuild7
2 files changed, 38 insertions, 1 deletions
diff --git a/dev-python/random2/files/random2-1.0.1-py39-tests.patch b/dev-python/random2/files/random2-1.0.1-py39-tests.patch
new file mode 100644
index 000000000000..48317af2f258
--- /dev/null
+++ b/dev-python/random2/files/random2-1.0.1-py39-tests.patch
@@ -0,0 +1,32 @@
+From a60d5ce10e5df0cebd7e7de0bff6f291bf9403ca Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Sat, 24 Oct 2020 20:57:00 +0200
+Subject: [PATCH] getrandbits() accepts 0 in python3_9
+
+---
+ src/tests.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/tests.py b/src/tests.py
+index d918891..6f600ab 100644
+--- a/src/tests.py
++++ b/src/tests.py
+@@ -291,7 +291,6 @@ class SystemRandom_TestBasicOps(TestBasicOps):
+ # Verify argument checking
+ self.assertRaises(TypeError, self.gen.getrandbits)
+ self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)
+- self.assertRaises(ValueError, self.gen.getrandbits, 0)
+ self.assertRaises(ValueError, self.gen.getrandbits, -1)
+ self.assertRaises(TypeError, self.gen.getrandbits, 10.1)
+
+@@ -448,7 +447,6 @@ class MersenneTwister_TestBasicOps(TestBasicOps):
+ 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)
+ self.assertRaises(ValueError, self.gen.getrandbits, -1)
+
+ def test_randbelow_logic(self, _log=log, int=int):
+--
+2.29.1
+
diff --git a/dev-python/random2/random2-1.0.1-r1.ebuild b/dev-python/random2/random2-1.0.1-r1.ebuild
index 0599ef488cdd..6eb84a539565 100644
--- a/dev-python/random2/random2-1.0.1-r1.ebuild
+++ b/dev-python/random2/random2-1.0.1-r1.ebuild
@@ -3,15 +3,20 @@
EAPI=7
-PYTHON_COMPAT=( python3_{6,7,8} )
+PYTHON_COMPAT=( python3_{6,7,8,9} )
inherit distutils-r1
DESCRIPTION="Python-2.7 random module ported to python-3"
HOMEPAGE="https://pypi.org/project/random2/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.zip"
+
LICENSE="PSF-2"
SLOT="0"
KEYWORDS="amd64 arm64 x86"
BDEPEND="app-arch/unzip
dev-python/setuptools[${PYTHON_USEDEP}]"
+
+distutils_enable_tests setup.py
+
+PATCHES=( "${FILESDIR}/${P}-py39-tests.patch" )