Skip to content

Commit 3005d25

Browse files
committed
fix(test.pickle): ad hoc fix for change in object.__reduce__ signature
fix #461
1 parent f604eb8 commit 3005d25

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test/pickle1.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
1
1010
>>> pickle1_ext.world.__name__
1111
'world'
12-
>>> pickle1_ext.world('Hello').__reduce__()
12+
>>> # XXX: until python 3.10: 2-element tuple
13+
>>> # XXX: since python 3.11: 3-element tuple (object's state added)
14+
>>> # https://docs.python.org/3.11/library/pickle.html#object.__reduce__
15+
>>> pickle1_ext.world('Hello').__reduce__()[:2]
1316
(<class 'pickle1_ext.world'>, ('Hello',))
1417
>>> wd = pickle1_ext.world('California')
1518
>>> pstr = pickle.dumps(wd)

test/pickle4.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
1
1313
>>> pickle4_ext.world.__name__
1414
'world'
15-
>>> pickle4_ext.world('Hello').__reduce__()
15+
>>> # XXX: until python 3.10: 2-element tuple
16+
>>> # XXX: since python 3.11: 3-element tuple (object's state added)
17+
>>> # https://docs.python.org/3.11/library/pickle.html#object.__reduce__
18+
>>> pickle4_ext.world('Hello').__reduce__()[:2]
1619
(<class 'pickle4_ext.world'>, ('Hello',))
1720
>>> wd = pickle4_ext.world('California')
1821
>>> pstr = pickle.dumps(wd)

0 commit comments

Comments
 (0)