Fix check for error condition
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 2e14abb..acff973 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -2107,7 +2107,7 @@
     return NULL;
   }
 
-  if (!pair_content(pair, &f, &b)) {
+  if (pair_content(pair, &f, &b)==ERR) {
     PyErr_SetString(PyCursesError,
 		    "Argument 1 was out of range. (1..COLOR_PAIRS-1)");
     return NULL;