diff --git a/0004-Make-Future.__repr__-subclass-friendly-bpo-22033-65.patch b/0004-Make-Future.__repr__-subclass-friendly-bpo-22033-65.patch new file mode 100644 index 0000000000000000000000000000000000000000..17db69efce0b21bf58e05a977055149efc7b13a1 --- /dev/null +++ b/0004-Make-Future.__repr__-subclass-friendly-bpo-22033-65.patch @@ -0,0 +1,66 @@ +From 765e7e17975477b4e2fa60256007c970057e018d Mon Sep 17 00:00:00 2001 +From: Lisandro Dalcin +Date: Tue, 3 Oct 2017 21:35:10 +0300 +Subject: [PATCH] Make Future.__repr__ subclass-friendly (bpo-22033) (#65) + ++ https://bugs.python.org/issue22033 + +Minor spelling fixes in docstrings (bpo-25523) + ++ https://bugs.python.org/issue25523 +--- + concurrent/futures/_base.py | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/concurrent/futures/_base.py b/concurrent/futures/_base.py +index ca2ebfb..401e488 100644 +--- a/concurrent/futures/_base.py ++++ b/concurrent/futures/_base.py +@@ -322,17 +322,20 @@ class Future(object): + with self._condition: + if self._state == FINISHED: + if self._exception: +- return '' % ( +- hex(id(self)), ++ return '<%s at %#x state=%s raised %s>' % ( ++ self.__class__.__name__, ++ id(self), + _STATE_TO_DESCRIPTION_MAP[self._state], + self._exception.__class__.__name__) + else: +- return '' % ( +- hex(id(self)), ++ return '<%s at %#x state=%s returned %s>' % ( ++ self.__class__.__name__, ++ id(self), + _STATE_TO_DESCRIPTION_MAP[self._state], + self._result.__class__.__name__) +- return '' % ( +- hex(id(self)), ++ return '<%s at %#x state=%s>' % ( ++ self.__class__.__name__, ++ id(self), + _STATE_TO_DESCRIPTION_MAP[self._state]) + + def cancel(self): +@@ -355,7 +358,7 @@ class Future(object): + return True + + def cancelled(self): +- """Return True if the future has cancelled.""" ++ """Return True if the future was cancelled.""" + with self._condition: + return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED] + +@@ -573,7 +576,7 @@ class Executor(object): + raise NotImplementedError() + + def map(self, fn, *iterables, **kwargs): +- """Returns a iterator equivalent to map(fn, iter). ++ """Returns an iterator equivalent to map(fn, iter). + + Args: + fn: A callable that will take as many arguments as there are +-- +2.39.0.windows.2 + diff --git a/python-futures.spec b/python-futures.spec index 9c6ce2a8e48826cb6a846f7bd0cc8a679fb03afc..e82b92be3a3c77b5045d86d21dc0328a7e378846 100644 --- a/python-futures.spec +++ b/python-futures.spec @@ -1,6 +1,6 @@ Name: python-futures Version: 3.1.1 -Release: 8 +Release: 9 Summary: Backport of the concurrent.futures standard library module to Python 3.2 License: Python URL: https://github.com/agronholm/pythonfutures @@ -8,6 +8,7 @@ Source0: https://files.pythonhosted.org/packages/source/f/futures/futures- Patch01: 0001-Backport-thread_name_prefix-from-upstream-64.patch Patch02: 0002-Specify-python_requires-to-prevent-installation-on-P.patch Patch03: 0003-Backport-fixes-to-as_completed-and-map-iterators-bpo.patch +Patch04: 0004-Make-Future.__repr__-subclass-friendly-bpo-22033-65.patch BuildRequires: python2-devel BuildArch: noarch @@ -42,6 +43,9 @@ The concurrent.futures module provides a high-level interface for asynchronously %{python2_sitelib}/futures-*.egg-info* %changelog +* Wed Dec 27 2023 zhangliangpengkun - 3.1.1-9 +- Make Future.__repr__ subclass-friendly (bpo-22033) (#65) + * Thu Dec 21 2023 zhangliangpengkun - 3.1.1-8 - Backport fixes to as_completed and map iterators (bpo-27144) (#66)