diff configmix/_speedups.c @ 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 7e480a32d9d5
children 8d2d5d54ff3c
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)",