14
0
forked from pool/python-urwid

- Add python-311.patch to fix tests for python 3.11

gh#urwid/urwid#517

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urwid?expand=0&rev=46
This commit is contained in:
2023-02-20 08:42:29 +00:00
committed by Git OBS Bridge
parent 14b7605f4b
commit c2fa0e629a
3 changed files with 33 additions and 3 deletions

23
python-311.patch Normal file
View File

@@ -0,0 +1,23 @@
Index: urwid-2.1.2/urwid/tests/test_event_loops.py
===================================================================
--- urwid-2.1.2.orig/urwid/tests/test_event_loops.py
+++ urwid-2.1.2/urwid/tests/test_event_loops.py
@@ -201,15 +201,14 @@ else:
evl.alarm(0.5, lambda: 1 / 0) # Simulate error in event loop
self.assertRaises(ZeroDivisionError, evl.run)
- def test_coroutine_error(self):
+ async def test_coroutine_error(self):
evl = self.evl
- @asyncio.coroutine
- def error_coro():
+ async def error_coro():
result = 1 / 0 # Simulate error in coroutine
yield result
- asyncio.ensure_future(error_coro())
+ asyncio.ensure_future(await error_coro())
self.assertRaises(ZeroDivisionError, evl.run)

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Feb 20 08:41:44 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Add python-311.patch to fix tests for python 3.11
gh#urwid/urwid#517
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Nov 8 12:13:49 UTC 2021 - Dirk Müller <dmueller@suse.com> Mon Nov 8 12:13:49 UTC 2021 - Dirk Müller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-urwid # spec file for package python-urwid
# #
# Copyright (c) 2021 SUSE LLC # Copyright (c) 2023 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,6 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2 %bcond_without python2
Name: python-urwid Name: python-urwid
Version: 2.1.2 Version: 2.1.2
@@ -25,6 +24,8 @@ Summary: A full-featured console (xterm et al.) user interface library
License: LGPL-2.1-or-later License: LGPL-2.1-or-later
URL: http://urwid.org URL: http://urwid.org
Source: https://files.pythonhosted.org/packages/source/u/urwid/urwid-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/u/urwid/urwid-%{version}.tar.gz
# PATCH-FIX-UPSTREAM python-311.patch gh#urwid/urwid#517
Patch0: python-311.patch
BuildRequires: %{python_module devel} BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: fdupes BuildRequires: fdupes
@@ -50,7 +51,7 @@ useful for text console application developers including:
- Python 3.2 support - Python 3.2 support
%prep %prep
%setup -q -n "urwid-%{version}" %autosetup -p1 -n "urwid-%{version}"
# remove unwanted shebang # remove unwanted shebang
find urwid -name "*.py" | xargs sed -i '1 { /^#!/ d }' find urwid -name "*.py" | xargs sed -i '1 { /^#!/ d }'