Get rid of a SyntaxWarning in test_random.py

f38
Paul Howarth 3 years ago
parent c0acebf377
commit 84cd9c6866

@ -0,0 +1,11 @@
--- lib/Crypto/SelfTest/Random/test_random.py
+++ lib/Crypto/SelfTest/Random/test_random.py
@@ -102,7 +102,7 @@ class SimpleTest(unittest.TestCase):
for i in range(10):
self.assertEqual(random.choice((1,2,3)) in (1,2,3), True)
self.assertEqual(random.choice([1,2,3]) in [1,2,3], True)
- if sys.version_info[0] is 3:
+ if sys.version_info[0] == 3:
self.assertEqual(random.choice(bytearray(b('123'))) in bytearray(b('123')), True)
self.assertEqual(1, random.choice([1]))
self.assertRaises(IndexError, random.choice, [])

@ -24,6 +24,7 @@ Patch8: python-crypto-2.6.1-python3.10.patch
Patch9: python-crypto-2.6.1-python3.11.patch
Patch10: python-crypto-2.6.1-python3only.patch
Patch11: python-crypto-2.6.1-no-distutils.patch
Patch12: python-crypto-2.6.1-SyntaxWarning.patch
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: gcc
@ -102,6 +103,9 @@ rm -rf src/libtom
# Drop use of deprecated distutils, going away in Python 3.12
%patch11
# Get rid of a SyntaxWarning in test_random.py
%patch12
%build
%global optflags %{optflags} -fno-strict-aliasing
%py3_build
@ -128,6 +132,7 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} pct-speedtest.py
* Thu Nov 11 2021 Paul Howarth <paul@city-fan.org> - 2.6.1-38
- Convert all code to Python 3 before the ability to use 2to3 goes away
- Drop use of deprecated distutils, going away in Python 3.12
- Get rid of a SyntaxWarning in test_random.py
* Wed Nov 10 2021 Paul Howarth <paul@city-fan.org> - 2.6.1-37
- Fix Python 3.11 compatibility (#2021808)

Loading…
Cancel
Save