Skip to content

Commit

Permalink
Use more PyUnicode_EqualToUTF8().
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Nov 6, 2024
1 parent 78daa5e commit 3f74f1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Modules/_pickle.c
Original file line number Diff line number Diff line change
Expand Up @@ -7603,7 +7603,7 @@ static PyObject *
Unpickler_getattr(PyObject *self, PyObject *name)
{
if (PyUnicode_Check(name)
&& PyUnicode_CompareWithASCIIString(name, "persistent_load") == 0
&& PyUnicode_EqualToUTF8(name, "persistent_load")
&& ((UnpicklerObject *)self)->persistent_load_attr)
{
return Py_NewRef(((UnpicklerObject *)self)->persistent_load_attr);
Expand All @@ -7616,7 +7616,7 @@ static int
Unpickler_setattr(PyObject *self, PyObject *name, PyObject *value)
{
if (PyUnicode_Check(name)
&& PyUnicode_CompareWithASCIIString(name, "persistent_load") == 0)
&& PyUnicode_EqualToUTF8(name, "persistent_load"))
{
Py_XINCREF(value);
Py_XSETREF(((UnpicklerObject *)self)->persistent_load_attr, value);
Expand Down

0 comments on commit 3f74f1a

Please sign in to comment.