]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-141757: Comply with pickle protocol in test_reduce_5tuple (GH-141759) ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 20 Nov 2025 09:20:00 +0000 (10:20 +0100)
committerGitHub <noreply@github.com>
Thu, 20 Nov 2025 09:20:00 +0000 (09:20 +0000)
The 5th element of the __reduce__ tuple should be an iterator.
(cherry picked from commit 41b9ad5b38e913194a5cc88f0e7cfc096787b664)

Co-authored-by: Arseny Boykov <36469655+Bobronium@users.noreply.github.com>
Lib/test/test_copy.py

index 3dec64cc9a24141d606fe9a0c0e1b9b7f63ed807..69a981cd14ca7b0413b817957e9158f86481cee8 100644 (file)
@@ -666,7 +666,7 @@ class TestCopy(unittest.TestCase):
     def test_reduce_5tuple(self):
         class C(dict):
             def __reduce__(self):
-                return (C, (), self.__dict__, None, self.items())
+                return (C, (), self.__dict__, None, iter(self.items()))
             def __eq__(self, other):
                 return (dict(self) == dict(other) and
                         self.__dict__ == other.__dict__)