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

diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index 8901b42..4b482bf 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -310,8 +310,7 @@
 
     if (!PyTuple_Check(retobj) || PyTuple_GET_SIZE(retobj) != 2 ||
         !PyUnicode_Check((tobj = PyTuple_GET_ITEM(retobj, 0))) ||
-        !(PyInt_Check(PyTuple_GET_ITEM(retobj, 1)) ||
-          PyLong_Check(PyTuple_GET_ITEM(retobj, 1)))) {
+        !_PyAnyInt_Check(PyTuple_GET_ITEM(retobj, 1))) {
         PyErr_SetString(PyExc_TypeError,
                         "encoding error handler must return "
                         "(unicode, int) tuple");
@@ -430,8 +429,7 @@
 
     if (!PyTuple_Check(retobj) || PyTuple_GET_SIZE(retobj) != 2 ||
         !PyUnicode_Check((retuni = PyTuple_GET_ITEM(retobj, 0))) ||
-        !(PyInt_Check(PyTuple_GET_ITEM(retobj, 1)) ||
-          PyLong_Check(PyTuple_GET_ITEM(retobj, 1)))) {
+        !_PyAnyInt_Check(PyTuple_GET_ITEM(retobj, 1))) {
         PyErr_SetString(PyExc_TypeError,
                         "decoding error handler must return "
                         "(unicode, int) tuple");