[2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 935712a..0ec4ee1 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -194,7 +194,7 @@
static int
PyCurses_ConvertToChtype(PyObject *obj, chtype *ch)
{
- if (PyInt_Check(obj) || PyLong_Check(obj)) {
+ if (_PyAnyInt_Check(obj)) {
*ch = (chtype) PyInt_AsLong(obj);
if (*ch == (chtype) -1 && PyErr_Occurred())
return 0;
@@ -2603,7 +2603,7 @@
if (!PyArg_ParseTuple(args,"O;ch or int",&temp)) return NULL;
- if (PyInt_Check(temp) || PyLong_Check(temp)) {
+ if (_PyAnyInt_Check(temp)) {
ch = (chtype) PyInt_AsLong(temp);
if (ch == (chtype) -1 && PyErr_Occurred())
return NULL;
@@ -2628,7 +2628,7 @@
if (!PyArg_ParseTuple(args,"O;ch or int",&temp)) return NULL;
- if (PyInt_Check(temp) || PyLong_Check(temp)) {
+ if (_PyAnyInt_Check(temp)) {
ch = (int) PyInt_AsLong(temp);
if (ch == -1 && PyErr_Occurred())
return NULL;