[2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)

diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index a66aa69..d50e4c6 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -423,10 +423,9 @@
 
     /* Py_None is a singleton */
     if (op == Py_None
-       || PyInt_CheckExact(op)
-       || PyLong_CheckExact(op)
-       || PyBool_Check(op)
-       || PyBytes_CheckExact(op)
+        || _PyAnyInt_CheckExact(op)
+        || PyBool_Check(op)
+        || PyBytes_CheckExact(op)
 #ifdef Py_USING_UNICODE
        || PyUnicode_CheckExact(op)
 #endif