Mercurial > hgrepos > Python > libs > ConfigMix
changeset 618:8dc514bd3d5e
Use py_object_is when comparing to MISSING
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Wed, 12 Jan 2022 13:44:12 +0100 |
| parents | 98c3669d4df1 |
| children | 75ecbe07abff |
| files | configmix/_speedups.c |
| diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/configmix/_speedups.c Wed Jan 12 09:32:59 2022 +0100 +++ b/configmix/_speedups.c Wed Jan 12 13:44:12 2022 +0100 @@ -759,7 +759,7 @@ res = PyDict_GetItem(cache, s); /* borrowed */ if (res != NULL) { - if (res == sstate->MISSING) { + if (py_object_is(res, sstate->MISSING)) { return PyErr_Format( PyExc_KeyError, "Cannot interpolate variables in string %R (cached)", @@ -1002,7 +1002,7 @@ if (cache != NULL) { result = PyDict_GetItem(cache, s); /* borrowed */ if (result != NULL) { - if (result == sstate->MISSING) { + if (py_object_is(result, sstate->MISSING)) { return PyErr_Format( PyExc_KeyError, "Cannot interpolate variables in string %R (cached)",
