diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-16 21:48:02 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-16 21:48:02 (GMT) |
commit | 8fa8ee3970f095f47f045891afe118836280e551 (patch) | |
tree | 7f64afb1084a746b1ecd7e293fbbddeeb5f270d5 /Modules/_sre.c | |
parent | 5c03d2075782eab58b33ecc114abb8df025e6057 (diff) | |
download | cpython-8fa8ee3970f095f47f045891afe118836280e551.zip cpython-8fa8ee3970f095f47f045891afe118836280e551.tar.gz cpython-8fa8ee3970f095f47f045891afe118836280e551.tar.bz2 |
Issue #18701: Remove support of old CPython versions (<3.0) from C code.
Diffstat (limited to 'Modules/_sre.c')
-rw-r--r-- | Modules/_sre.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c index a6933e8..41ed667 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -70,10 +70,6 @@ static char copyright[] = /* enables copy/deepcopy handling (work in progress) */ #undef USE_BUILTIN_COPY -#if PY_VERSION_HEX < 0x01060000 -#define PyObject_DEL(op) PyMem_DEL((op)) -#endif - /* -------------------------------------------------------------------- */ #if defined(_MSC_VER) @@ -1993,10 +1989,8 @@ join_list(PyObject* list, PyObject* string) /* join list elements */ PyObject* joiner; -#if PY_VERSION_HEX >= 0x01060000 PyObject* function; PyObject* args; -#endif PyObject* result; joiner = PySequence_GetSlice(string, 0, 0); @@ -2008,7 +2002,6 @@ join_list(PyObject* list, PyObject* string) return joiner; } -#if PY_VERSION_HEX >= 0x01060000 function = PyObject_GetAttrString(joiner, "join"); if (!function) { Py_DECREF(joiner); @@ -2024,12 +2017,6 @@ join_list(PyObject* list, PyObject* string) result = PyObject_CallObject(function, args); Py_DECREF(args); /* also removes list */ Py_DECREF(function); -#else - result = call( - "string", "join", - PyTuple_Pack(2, list, joiner) - ); -#endif Py_DECREF(joiner); return result; @@ -2136,7 +2123,6 @@ error: } -#if PY_VERSION_HEX >= 0x02020000 static PyObject* pattern_finditer(PatternObject* pattern, PyObject* args, PyObject* kw) { @@ -2158,7 +2144,6 @@ pattern_finditer(PatternObject* pattern, PyObject* args, PyObject* kw) return iterator; } -#endif static PyObject* pattern_split(PatternObject* self, PyObject* args, PyObject* kw) @@ -2581,10 +2566,8 @@ static PyMethodDef pattern_methods[] = { pattern_split_doc}, {"findall", (PyCFunction) pattern_findall, METH_VARARGS|METH_KEYWORDS, pattern_findall_doc}, -#if PY_VERSION_HEX >= 0x02020000 {"finditer", (PyCFunction) pattern_finditer, METH_VARARGS|METH_KEYWORDS, pattern_finditer_doc}, -#endif {"scanner", (PyCFunction) pattern_scanner, METH_VARARGS|METH_KEYWORDS}, {"__copy__", (PyCFunction) pattern_copy, METH_NOARGS}, {"__deepcopy__", (PyCFunction) pattern_deepcopy, METH_O}, |