diff --git a/fix-use-trio-lowlevel-instead-of-trio.patch b/fix-use-trio-lowlevel-instead-of-trio.patch new file mode 100644 index 0000000..f2f9721 --- /dev/null +++ b/fix-use-trio-lowlevel-instead-of-trio.patch @@ -0,0 +1,53 @@ +From a57465c94ba3a401531853b42e1bd071bcd2e93c Mon Sep 17 00:00:00 2001 +From: Tamas Nepusz +Date: Mon, 2 Nov 2020 15:48:51 +0100 +Subject: [PATCH] fix: use trio.lowlevel instead of trio.hazmat with Trio >= + 0.15 + +--- + urwid/_async_kw_event_loop.py | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/urwid/_async_kw_event_loop.py b/urwid/_async_kw_event_loop.py +index d146a49..4038405 100644 +--- a/urwid/_async_kw_event_loop.py ++++ b/urwid/_async_kw_event_loop.py +@@ -42,7 +42,11 @@ class TrioEventLoop(EventLoop): + self._nursery = None + + self._sleep = trio.sleep +- self._wait_readable = trio.hazmat.wait_readable ++ try: ++ self._wait_readable = trio.lowlevel.wait_readable ++ except AttributeError: ++ # Trio 0.14 or older ++ self._wait_readable = trio.hazmat.wait_readable + + def alarm(self, seconds, callback): + """Calls `callback()` a given time from now. No parameters are passed +@@ -155,12 +159,20 @@ class TrioEventLoop(EventLoop): + + emulate_idle_callbacks = TrioIdleCallbackInstrument() + ++ try: ++ add_instrument = self._trio.lowlevel.add_instrument ++ remove_instrument = self._trio.lowlevel.remove_instrument ++ except AttributeError: ++ # Trio 0.14 or older ++ add_instrument = self._trio.hazmat.add_instrument ++ remove_instrument = self._trio.hazmat.remove_instrument ++ + with self._trio.MultiError.catch(self._handle_main_loop_exception): +- self._trio.hazmat.add_instrument(emulate_idle_callbacks) ++ add_instrument(emulate_idle_callbacks) + try: + await self._main_task() + finally: +- self._trio.hazmat.remove_instrument(emulate_idle_callbacks) ++ remove_instrument(emulate_idle_callbacks) + + def watch_file(self, fd, callback): + """Calls `callback()` when the given file descriptor has some data +-- +2.39.0.windows.2 + diff --git a/python-urwid.spec b/python-urwid.spec index 29abe26..be420cf 100644 --- a/python-urwid.spec +++ b/python-urwid.spec @@ -1,10 +1,11 @@ Name: python-urwid Version: 2.1.2 -Release: 2 +Release: 3 Summary: Console user interface library License: LGPLv2+ URL: http://excess.org/urwid/ Source0: https://pypi.python.org/packages/source/u/urwid/urwid-%{version}.tar.gz +Patch0: fix-use-trio-lowlevel-instead-of-trio.patch %description Urwid is a console user interface library for Python. It includes @@ -40,6 +41,9 @@ PYTHON=%{__python3} %{__python3} setup.py test %{python3_sitearch}/urwid-%{version}*.egg-info %changelog +* Fri Jan 13 2023 zhangliangpengkun - 2.1.2-3 +- fix-use-trio-lowlevel-instead-of-trio.patch + * Tue Jul 27 2021 liyanan - 2.1.2-2 - Add buildrequires glibc-all-langpacks to fix build failed