fix condition (#14296)
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 631201f..03b3b95 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -107,7 +107,7 @@
 #include <sched.h>
 #endif
 
-#if defined(CPU_ALLOC) && defined(HAVE_SCHED_SETAFFINITY)
+#if !defined(CPU_ALLOC) && defined(HAVE_SCHED_SETAFFINITY)
 #undef HAVE_SCHED_SETAFFINITY
 #endif