Skip to content

Commit

Permalink
Accept truthy value in setstate
Browse files Browse the repository at this point in the history
  • Loading branch information
nineteendo committed Oct 31, 2024
1 parent ad6c2a5 commit 9ebc398
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Python/bltinmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1534,9 +1534,10 @@ PyDoc_STRVAR(setstate_doc, "Set state information for unpickling.");
static PyObject *
map_setstate(mapobject *lz, PyObject *state)
{
// For now we keep things strict, rather than using PyObject_IsTrue().
int strict = state == Py_True;
lz->strict = strict;
int strict = PyObject_IsTrue(state);
if (strict < 0) {
return NULL;
}
Py_RETURN_NONE;
}

Expand Down

0 comments on commit 9ebc398

Please sign in to comment.