# HG changeset patch # User Franz Glasner # Date 1641991452 -3600 # Node ID 8dc514bd3d5e97c6e125d7b90316f0ebfd89f265 # Parent 98c3669d4df1b5bfa6b47213eb4a539467c610a7 Use py_object_is when comparing to MISSING diff -r 98c3669d4df1 -r 8dc514bd3d5e configmix/_speedups.c --- 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)",