aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plpython/plpython.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2020-01-08 21:48:44 +0100
committerPeter Eisentraut <peter@eisentraut.org>2020-01-08 22:47:22 +0100
commit37f21ed132d1c5aee88e81fee0a0b7e735673d35 (patch)
tree42c54d36c636f68c961783f5a6252ed743b80122 /src/pl/plpython/plpython.h
parentf5d28710c707ad602cd869602e092cc9d538cbb9 (diff)
downloadpostgresql-37f21ed132d1c5aee88e81fee0a0b7e735673d35.tar.gz
postgresql-37f21ed132d1c5aee88e81fee0a0b7e735673d35.zip
Remove support for Python older than 2.6
Supporting very old Python versions is a maintenance burden, especially with the several variant test files to maintain for Python <2.6. Since we have dropped support for older OpenSSL versions in 7b283d0e1d1d79bf1c962d790c94d2a53f3bb38a, RHEL 5 is now effectively desupported, and that was also the only mainstream operating system still using Python versions before 2.6, so it's a good time to drop those as well. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/98b69261-298c-13d2-f34d-836fd9c29b21%402ndquadrant.com
Diffstat (limited to 'src/pl/plpython/plpython.h')
-rw-r--r--src/pl/plpython/plpython.h29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/pl/plpython/plpython.h b/src/pl/plpython/plpython.h
index 4a1df3ee7ea..6d981a0a06d 100644
--- a/src/pl/plpython/plpython.h
+++ b/src/pl/plpython/plpython.h
@@ -60,16 +60,6 @@
#endif
/*
- * Py_ssize_t compat for Python <= 2.4
- */
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
-typedef int Py_ssize_t;
-
-#define PY_SSIZE_T_MAX INT_MAX
-#define PY_SSIZE_T_MIN INT_MIN
-#endif
-
-/*
* Python 2/3 strings/unicode/bytes handling. Python 2 has strings
* and unicode, Python 3 has strings, which are unicode on the C
* level, and bytes. The porting convention, which is similarly used
@@ -80,15 +70,6 @@ typedef int Py_ssize_t;
* string to a Python string it converts the C string from the
* PostgreSQL server encoding to a Python Unicode object.
*/
-
-#if PY_VERSION_HEX < 0x02060000
-/* This is exactly the compatibility layer that Python 2.6 uses. */
-#define PyBytes_AsString PyString_AsString
-#define PyBytes_FromStringAndSize PyString_FromStringAndSize
-#define PyBytes_Size PyString_Size
-#define PyObject_Bytes PyObject_Str
-#endif
-
#if PY_MAJOR_VERSION >= 3
#define PyString_Check(x) 0
#define PyString_AsString(x) PLyUnicode_AsString(x)
@@ -104,16 +85,6 @@ typedef int Py_ssize_t;
#define PyInt_AsLong(x) PyLong_AsLong(x)
#endif
-/*
- * PyVarObject_HEAD_INIT was added in Python 2.6. Its use is
- * necessary to handle both Python 2 and 3. This replacement
- * definition is for Python <=2.5
- */
-#ifndef PyVarObject_HEAD_INIT
-#define PyVarObject_HEAD_INIT(type, size) \
- PyObject_HEAD_INIT(type) size,
-#endif
-
/* Python 3 removed the Py_TPFLAGS_HAVE_ITER flag */
#if PY_MAJOR_VERSION >= 3
#define Py_TPFLAGS_HAVE_ITER 0