From 725b0211535ef605b47a7ca4a09a38710cb9b8b6 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Mon, 31 Mar 2025 19:49:28 +0900 Subject: [PATCH] fix(test.pickle): ad hoc fix for change in object.__reduce__ signature fix #461 --- test/pickle1.py | 5 ++++- test/pickle4.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/pickle1.py b/test/pickle1.py index b8f4efd9b0..ed8dce8c41 100644 --- a/test/pickle1.py +++ b/test/pickle1.py @@ -9,7 +9,10 @@ 1 >>> pickle1_ext.world.__name__ 'world' - >>> pickle1_ext.world('Hello').__reduce__() + >>> # XXX: until python 3.10: 2-element tuple + >>> # XXX: since python 3.11: 3-element tuple (object's state added) + >>> # https://docs.python.org/3.11/library/pickle.html#object.__reduce__ + >>> pickle1_ext.world('Hello').__reduce__()[:2] (, ('Hello',)) >>> wd = pickle1_ext.world('California') >>> pstr = pickle.dumps(wd) diff --git a/test/pickle4.py b/test/pickle4.py index be813bbb13..acdebc266f 100644 --- a/test/pickle4.py +++ b/test/pickle4.py @@ -12,7 +12,10 @@ 1 >>> pickle4_ext.world.__name__ 'world' - >>> pickle4_ext.world('Hello').__reduce__() + >>> # XXX: until python 3.10: 2-element tuple + >>> # XXX: since python 3.11: 3-element tuple (object's state added) + >>> # https://docs.python.org/3.11/library/pickle.html#object.__reduce__ + >>> pickle4_ext.world('Hello').__reduce__()[:2] (, ('Hello',)) >>> wd = pickle4_ext.world('California') >>> pstr = pickle.dumps(wd)