From 84cd9c68664dc5e5d9f9126e644342443de6c2fe Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Nov 11 2021 19:36:23 +0000 Subject: Get rid of a SyntaxWarning in test_random.py --- diff --git a/python-crypto-2.6.1-SyntaxWarning.patch b/python-crypto-2.6.1-SyntaxWarning.patch new file mode 100644 index 0000000..6adaeec --- /dev/null +++ b/python-crypto-2.6.1-SyntaxWarning.patch @@ -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, []) diff --git a/python-crypto.spec b/python-crypto.spec index 4fa57e0..53a7090 100644 --- a/python-crypto.spec +++ b/python-crypto.spec @@ -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 - 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 - 2.6.1-37 - Fix Python 3.11 compatibility (#2021808)