aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Modules/_sre.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_sre.c')
-rw-r--r--Modules/_sre.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c
index 09b58352de4..6f8ec0e5381 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -35,7 +35,7 @@
* other compatibility work.
*/
-static char copyright[] =
+static const char copyright[] =
" SRE 2.2.2 Copyright (c) 1997-2002 by Secret Labs AB ";
#define PY_SSIZE_T_CLEAN
@@ -62,9 +62,6 @@ static char copyright[] =
/* -------------------------------------------------------------------- */
/* optional features */
-/* enables fast searching */
-#define USE_FAST_SEARCH
-
/* enables copy/deepcopy handling (work in progress) */
#undef USE_BUILTIN_COPY
@@ -717,7 +714,7 @@ _sre_SRE_Pattern_search_impl(PatternObject *self, PyObject *string,
}
static PyObject*
-call(char* module, char* function, PyObject* args)
+call(const char* module, const char* function, PyObject* args)
{
PyObject* name;
PyObject* mod;
@@ -2052,8 +2049,9 @@ match_getindex(MatchObject* self, PyObject* index)
/* Default value */
return 0;
- if (PyLong_Check(index))
- return PyLong_AsSsize_t(index);
+ if (PyIndex_Check(index)) {
+ return PyNumber_AsSsize_t(index, NULL);
+ }
i = -1;