diff --git a/python-urwid-test_event_loops.patch b/python-urwid-test_event_loops.patch new file mode 100644 index 0000000..2622a0e --- /dev/null +++ b/python-urwid-test_event_loops.patch @@ -0,0 +1,32 @@ +commit 4b0ed8b6030450e6d99909a7c683e9642e546387 +Author: Michael Hudson-Doyle +Date: Wed Jun 7 13:52:17 2017 -0700 + + fix test_remove_watch_file flakiness + + pass a known-good file descriptor to watch_file rather than hard-coding 5 + + Fixes #164 + +diff --git a/urwid/tests/test_event_loops.py b/urwid/tests/test_event_loops.py +index c85bbed..b01212d 100644 +--- a/urwid/tests/test_event_loops.py ++++ b/urwid/tests/test_event_loops.py +@@ -30,9 +30,14 @@ class EventLoopTestMixin(object): + + def test_remove_watch_file(self): + evl = self.evl +- handle = evl.watch_file(5, lambda: None) +- self.assertTrue(evl.remove_watch_file(handle)) +- self.assertFalse(evl.remove_watch_file(handle)) ++ fd_r, fd_w = os.pipe() ++ try: ++ handle = evl.watch_file(fd_r, lambda: None) ++ self.assertTrue(evl.remove_watch_file(handle)) ++ self.assertFalse(evl.remove_watch_file(handle)) ++ finally: ++ os.close(fd_r) ++ os.close(fd_w) + + _expected_idle_handle = 1 + diff --git a/python-urwid.spec b/python-urwid.spec index b74d064..04dd72f 100644 --- a/python-urwid.spec +++ b/python-urwid.spec @@ -10,6 +10,9 @@ Source0: https://pypi.python.org/packages/source/u/urwid/urwid-%{version}. # https://github.com/urwid/urwid/pull/237/commits/f68f2cf089cfd5ec45863baf59a91d5aeb0cf5c3 Patch0: python-urwid-test_vterm-EINTR.patch +# https://github.com/urwid/urwid/commit/4b0ed8b6030450e6d99909a7c683e9642e546387 +Patch1: python-urwid-test_event_loops.patch + %global _description\ Urwid is a Python library for making text console applications. It has\ many features including fluid interface resizing, support for UTF-8 and\ @@ -46,6 +49,7 @@ BuildRequires: /usr/bin/2to3 %prep %setup -q -n urwid-%{version} %patch0 -p1 +%patch1 -p1 find urwid -type f -name "*.py" -exec sed -i -e '/^#!\//, 1d' {} \; find urwid -type f -name "*.py" -exec chmod 644 {} \; @@ -90,6 +94,7 @@ popd %changelog * Wed Nov 15 2017 David Cantrell - 1.3.1-2 - Apply upstream fix for EINTR handling in test_vterm test case +- Apply upstream fix for test_remove_watch_file flakiness * Sat Aug 19 2017 Petr Viktorin - 1.3.1-1 - Update to upstream bugfix release 1.3.1