[3.14] gh-141757: Comply with pickle protocol in test_reduce_5tuple (GH-141759) (GH-141782)
Some checks are pending
Tests / (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Windows MSI (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / Check if the ABI has changed (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / iOS (push) Blocked by required conditions
Tests / Android (aarch64) (push) Blocked by required conditions
Tests / Android (x86_64) (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Sanitizers (push) Blocked by required conditions
Tests / Cross build Linux (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run

The 5th element of the __reduce__ tuple should be an iterator.
(cherry picked from commit 41b9ad5b38)

Co-authored-by: Arseny Boykov <36469655+Bobronium@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2025-11-20 10:22:52 +01:00 committed by GitHub
parent 83cfd87568
commit daf98fe5bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -672,7 +672,7 @@ class TestCopy(unittest.TestCase):
def test_reduce_5tuple(self): def test_reduce_5tuple(self):
class C(dict): class C(dict):
def __reduce__(self): def __reduce__(self):
return (C, (), self.__dict__, None, self.items()) return (C, (), self.__dict__, None, iter(self.items()))
def __eq__(self, other): def __eq__(self, other):
return (dict(self) == dict(other) and return (dict(self) == dict(other) and
self.__dict__ == other.__dict__) self.__dict__ == other.__dict__)