#2 Fix Python 3.11 compatibility
Merged 2 years ago by churchyard. Opened 2 years ago by music.
rpms/ music/python-opentracing asyncio-coroutine  into  rawhide

file added
+42
@@ -0,0 +1,42 @@ 

+ From 4cb5d333eabcb05153a586dc1a7db0df555f0453 Mon Sep 17 00:00:00 2001

+ From: "Benjamin A. Beasley" <code@musicinmybrain.net>

+ Date: Sat, 11 Jun 2022 08:35:03 -0400

+ Subject: [PATCH] =?UTF-8?q?Replace=20@asyncio.coroutine=20with=20=E2=80=9C?=

+  =?UTF-8?q?async=20def=E2=80=9D?=

+ MIME-Version: 1.0

+ Content-Type: text/plain; charset=UTF-8

+ Content-Transfer-Encoding: 8bit

+ 

+ ---

+  tests/scope_managers/test_asyncio.py     | 3 +--

+  tests/scope_managers/test_contextvars.py | 3 +--

+  2 files changed, 2 insertions(+), 4 deletions(-)

+ 

+ diff --git a/tests/scope_managers/test_asyncio.py b/tests/scope_managers/test_asyncio.py

+ index 14079c4..4817f80 100644

+ --- a/tests/scope_managers/test_asyncio.py

+ +++ b/tests/scope_managers/test_asyncio.py

+ @@ -35,8 +35,7 @@ def scope_manager(self):

+          return AsyncioScopeManager()

+  

+      def run_test(self, test_fn):

+ -        @asyncio.coroutine

+ -        def async_test_fn():

+ +        async def async_test_fn():

+              test_fn()

+          asyncio.get_event_loop().run_until_complete(async_test_fn())

+  

+ diff --git a/tests/scope_managers/test_contextvars.py b/tests/scope_managers/test_contextvars.py

+ index dd1820f..c8c6f61 100644

+ --- a/tests/scope_managers/test_contextvars.py

+ +++ b/tests/scope_managers/test_contextvars.py

+ @@ -36,8 +36,7 @@ def scope_manager(self):

+          return ContextVarsScopeManager()

+  

+      def run_test(self, test_fn):

+ -        @asyncio.coroutine

+ -        def async_test_fn():

+ +        async def async_test_fn():

+              test_fn()

+          asyncio.get_event_loop().run_until_complete(async_test_fn())

+  

file modified
+7 -1
@@ -14,7 +14,7 @@ 

  Summary:        OpenTracing interface for Python

  Name:           python-opentracing

  Version:        2.4.0

- Release:        5%{?dist}

+ Release:        6%{?dist}

  

  # The files are under the Apache License 2.0,

  # except for:
@@ -30,6 +30,9 @@ 

  # Issue filed upstream as https://github.com/opentracing/opentracing-python/issues/142

  # Upstream has merged the change on master as https://github.com/opentracing/opentracing-python/pull/143

  Patch0:         0001-Do-not-use-mock-the-PyPI-backport-library-when-possi.patch

+ # Replace @asyncio.coroutine with “async def” for Python 3.11

+ # https://github.com/opentracing/opentracing-python/pull/159

+ Patch1:         %{url}/pull/159.patch

  

  BuildArch:      noarch

  
@@ -129,6 +132,9 @@ 

  %endif

  

  %changelog

+ * Mon Jun 20 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 2.4.0-6

+ - Fix Python 3.11 compatibility

+ 

  * Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 2.4.0-5

  - Rebuilt for Python 3.11

  

In the tests, replace the asyncio.coroutine decorator, which is deprecated since Python 3.8 and removed in 3.11, with “async def”.

The patch was submitted upstream.

rebased onto 4a74ca6

2 years ago

Pull-Request has been merged by churchyard

2 years ago
Metadata