[3.14] GH-140590: Fix setstate for functools.partial C-module (GH-140671) (#140698)

GH-140590: Fix setstate for functools.partial C-module (GH-140671)

(cherry picked from commit d26686a7f8)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-10-28 13:45:27 +01:00 committed by GitHub
parent 84e01df175
commit 02604314ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View file

@ -406,6 +406,7 @@ def test_setstate(self):
def test_setstate_errors(self):
f = self.partial(signature)
self.assertRaises(TypeError, f.__setstate__, (capture, (), {}))
self.assertRaises(TypeError, f.__setstate__, (capture, (), {}, {}, None))
self.assertRaises(TypeError, f.__setstate__, [capture, (), {}, None])
@ -413,6 +414,8 @@ def test_setstate_errors(self):
self.assertRaises(TypeError, f.__setstate__, (capture, None, {}, None))
self.assertRaises(TypeError, f.__setstate__, (capture, [], {}, None))
self.assertRaises(TypeError, f.__setstate__, (capture, (), [], None))
self.assertRaises(TypeError, f.__setstate__, (capture, (), {}, ()))
self.assertRaises(TypeError, f.__setstate__, (capture, (), {}, 'test'))
def test_setstate_subclasses(self):
f = self.partial(signature)