Skip to content

Commit 3f2fdb2

Browse files
committed
FIX allow state_setter to be an arbitrary callable
1 parent 183f2b0 commit 3f2fdb2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/_pickle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3718,7 +3718,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
37183718

37193719
if (state_setter == Py_None)
37203720
state_setter = NULL;
3721-
else if (!PyFunction_Check(state_setter)) {
3721+
else if (!PyCallable_Check(state_setter)) {
37223722
PyErr_Format(st->PicklingError, "sixth element of the tuple "
37233723
"returned by __reduce__ must be a function, not %s",
37243724
Py_TYPE(state_setter)->tp_name);

0 commit comments

Comments
 (0)