From 315b425294b27c840851573c5e06d9c29801b2e28a3bee914452ea7754491ee5 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 15 May 2023 14:19:08 +0000 Subject: [PATCH] - Add patch handle-python-ssl-changes.patch: * Handle ssl.shared_ciphers() behaviour changing in Python 3.10. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-gevent?expand=0&rev=91 --- handle-python-ssl-changes.patch | 26 ++++++++++++++++++++++++++ python-gevent.changes | 7 +++++++ python-gevent.spec | 4 ++++ 3 files changed, 37 insertions(+) create mode 100644 handle-python-ssl-changes.patch diff --git a/handle-python-ssl-changes.patch b/handle-python-ssl-changes.patch new file mode 100644 index 0000000..e2d1d51 --- /dev/null +++ b/handle-python-ssl-changes.patch @@ -0,0 +1,26 @@ +Index: gevent-22.10.2/src/greentest/3.10/test_ssl.py +=================================================================== +--- gevent-22.10.2.orig/src/greentest/3.10/test_ssl.py ++++ gevent-22.10.2/src/greentest/3.10/test_ssl.py +@@ -2306,13 +2306,19 @@ class SimpleBackgroundTests(unittest.Tes + self.assertIs(sslobj._sslobj.owner, sslobj) + self.assertIsNone(sslobj.cipher()) + self.assertIsNone(sslobj.version()) +- self.assertIsNotNone(sslobj.shared_ciphers()) ++ try: ++ self.assertIsNotNone(sslobj.shared_ciphers()) ++ except AssertionError: ++ self.assertIsNone(sslobj.shared_ciphers()) + self.assertRaises(ValueError, sslobj.getpeercert) + if 'tls-unique' in ssl.CHANNEL_BINDING_TYPES: + self.assertIsNone(sslobj.get_channel_binding('tls-unique')) + self.ssl_io_loop(sock, incoming, outgoing, sslobj.do_handshake) + self.assertTrue(sslobj.cipher()) +- self.assertIsNotNone(sslobj.shared_ciphers()) ++ try: ++ self.assertIsNotNone(sslobj.shared_ciphers()) ++ except AssertionError: ++ self.assertIsNone(sslobj.shared_ciphers()) + self.assertIsNotNone(sslobj.version()) + self.assertTrue(sslobj.getpeercert()) + if 'tls-unique' in ssl.CHANNEL_BINDING_TYPES: diff --git a/python-gevent.changes b/python-gevent.changes index 618539f..8afbd79 100644 --- a/python-gevent.changes +++ b/python-gevent.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon May 15 14:18:03 UTC 2023 - Steve Kowalik + +- Add patch handle-python-ssl-changes.patch: + * Handle Python 3.10 changes where ssl.shared_ciphers() changes + behaviour. + ------------------------------------------------------------------- Mon May 15 13:44:48 UTC 2023 - Dirk Müller diff --git a/python-gevent.spec b/python-gevent.spec index 5fa88c4..9f54f14 100644 --- a/python-gevent.spec +++ b/python-gevent.spec @@ -39,6 +39,7 @@ Source100: %{name}-rpmlintrc # let's selectively disable the warning around the offending code Patch0: fix-no-return-in-nonvoid-function.patch Patch1: skip-tests-in-leap.patch +Patch2: handle-python-ssl-changes.patch BuildRequires: %{python_module Cython} BuildRequires: %{python_module cffi} BuildRequires: %{python_module devel} @@ -111,6 +112,9 @@ Documentation and examples for %{name}. %if 0%{?sle_version} <= 150300 %patch1 -p1 %endif +%if 0%{?is_opensuse} +%patch2 -p1 +%endif sed -i -e '1s!bin/env python!bin/python!' examples/*.py sed -i -e '1{/bin.*python/d}' src/gevent/tests/*.py