summaryrefslogtreecommitdiffstats
path: root/Modules/_sre.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-07-31 06:09:36 (GMT)
committerGitHub <noreply@github.com>2018-07-31 06:09:36 (GMT)
commit48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202 (patch)
tree6678ae7f56e368ef192b8e0f5988f7c317dbb246 /Modules/_sre.c
parentdc9039da239ee572eaaf56e4a026be1fc4d74e24 (diff)
downloadcpython-48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202.zip
cpython-48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202.tar.gz
cpython-48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202.tar.bz2
[2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)
Diffstat (limited to 'Modules/_sre.c')
-rw-r--r--Modules/_sre.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c
index efef8f5..081a1aa 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -3327,7 +3327,7 @@ match_getindex(MatchObject* self, PyObject* index)
{
Py_ssize_t i;
- if (PyInt_Check(index) || PyLong_Check(index))
+ if (_PyAnyInt_Check(index))
return PyInt_AsSsize_t(index);
i = -1;
@@ -3335,7 +3335,7 @@ match_getindex(MatchObject* self, PyObject* index)
if (self->pattern->groupindex) {
index = PyObject_GetItem(self->pattern->groupindex, index);
if (index) {
- if (PyInt_Check(index) || PyLong_Check(index))
+ if (_PyAnyInt_Check(index))
i = PyInt_AsSsize_t(index);
Py_DECREF(index);
} else