Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-89850: Remove reconstruct_method from Pickler_get_persid #100350

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions Modules/_pickle.c
Original file line number Diff line number Diff line change
Expand Up @@ -4999,13 +4999,12 @@ Pickler_set_memo(PicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored))
}

static PyObject *
Pickler_get_persid(PicklerObject *self, void *Py_UNUSED(ignored))
{
if (self->pers_func == NULL) {
Pickler_get_persid(PicklerObject *self, void *Py_UNUSED(ignored)) {
if (self->pers_func == NULL)
PyErr_SetString(PyExc_AttributeError, "persistent_id");
return NULL;
}
return reconstruct_method(self->pers_func, self->pers_func_self);
else
Py_INCREF(self->pers_func);
return self->pers_func;
}

static int
Expand Down