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

diff --git a/Modules/_csv.c b/Modules/_csv.c
index c39c0f1..ea7d089 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -224,7 +224,7 @@
     if (src == NULL)
         *target = dflt;
     else {
-        if (!PyInt_Check(src) && !PyLong_Check(src)) {
+        if (!_PyAnyInt_Check(src)) {
             PyErr_Format(PyExc_TypeError,
                          "\"%s\" must be an integer", name);
             return -1;
@@ -1452,7 +1452,7 @@
     if (!PyArg_UnpackTuple(args, "field_size_limit", 0, 1, &new_limit))
         return NULL;
     if (new_limit != NULL) {
-        if (!PyInt_Check(new_limit) && !PyLong_Check(new_limit)) {
+        if (!_PyAnyInt_Check(new_limit)) {
             PyErr_Format(PyExc_TypeError,
                          "limit must be an integer");
             return NULL;