diff --git a/py2-skip-tests-interrupted-syscall.patch b/py2-skip-tests-interrupted-syscall.patch new file mode 100644 index 0000000..7226b94 --- /dev/null +++ b/py2-skip-tests-interrupted-syscall.patch @@ -0,0 +1,22 @@ +diff --git a/urwid/tests/test_vterm.py b/urwid/tests/test_vterm.py +index 075c653..a530152 100644 +--- a/urwid/tests/test_vterm.py ++++ b/urwid/tests/test_vterm.py +@@ -174,6 +174,8 @@ class TermTest(unittest.TestCase): + self.write(edgewall % {'x': self.termsize[0] - 1, + 'y': self.termsize[1] - 1}) + ++ @unittest.skipIf(sys.version_info < (3, 0), ++ "tends to fail with Interrupted system call") + def test_horizontal_resize(self): + self.resize(80, 24) + self.edgewall() +@@ -186,6 +188,8 @@ class TermTest(unittest.TestCase): + self.flush() + self.expect('1-' + '\n' * 22 + '3-') + ++ @unittest.skipIf(sys.version_info < (3, 0), ++ "tends to fail with Interrupted system call") + def test_vertical_resize(self): + self.resize(80, 24) + self.edgewall() diff --git a/python-urwid.spec b/python-urwid.spec index 1da0c8b..d02e258 100644 --- a/python-urwid.spec +++ b/python-urwid.spec @@ -17,6 +17,12 @@ License: LGPLv2+ URL: http://excess.org/urwid/ Source0: http://excess.org/urwid/urwid-%{version}.tar.gz +# Some tests are failing under Python 2. +# This is fixed in Python 3, see: +# https://docs.python.org/3/whatsnew/3.5.html#pep-475-retry-system-calls-failing-with-eintr +Patch0: py2-skip-tests-interrupted-syscall.patch + + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) BuildRequires: python2-devel BuildRequires: python-setuptools @@ -67,6 +73,7 @@ This package contains the urwid module built for use with python3. %prep %setup -q -n urwid-%{version} +%patch0 -p1 find urwid -type f -name "*.py" -exec sed -i -e '/^#!\//, 1d' {} \; find urwid -type f -name "*.py" -exec chmod 644 {} \;