summaryrefslogtreecommitdiff
path: root/src/pl/plpython/plpy_util.c
diff options
context:
space:
mode:
authorAndres Freund2022-03-08 02:30:28 +0000
committerAndres Freund2022-03-08 02:30:28 +0000
commit9b7e24a2cb37fb52af13219f625cd719e364a346 (patch)
treec35fe718f0a8d8723631b5759a47e37bfb6f7fbf /src/pl/plpython/plpy_util.c
parentdb23464715f4792298c639153dda7bfd9ad9d602 (diff)
plpython: Code cleanup related to removal of Python 2 support.
Since 19252e8ec93 we reject Python 2 during build configuration. Now that the dust on the buildfarm has settled, remove Python 2 specific code, including the "Python 2/3 porting layer". The code to detect conflicts between plpython using Python 2 and 3 is not removed, in case somebody creates an out-of-tree version adding back support for Python 2. Reviewed-By: Peter Eisentraut <[email protected]> Reviewed-By: Tom Lane <[email protected]> Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/pl/plpython/plpy_util.c')
-rw-r--r--src/pl/plpython/plpy_util.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/pl/plpython/plpy_util.c b/src/pl/plpython/plpy_util.c
index 4a7d7264d79..22e2a599ad9 100644
--- a/src/pl/plpython/plpy_util.c
+++ b/src/pl/plpython/plpy_util.c
@@ -78,12 +78,6 @@ PLyUnicode_Bytes(PyObject *unicode)
* Convert a Python unicode object to a C string in PostgreSQL server
* encoding. No Python object reference is passed out of this
* function. The result is palloc'ed.
- *
- * Note that this function is disguised as PyString_AsString() when
- * using Python 3. That function returns a pointer into the internal
- * memory of the argument, which isn't exactly the interface of this
- * function. But in either case you get a rather short-lived
- * reference that you ought to better leave alone.
*/
char *
PLyUnicode_AsString(PyObject *unicode)
@@ -95,7 +89,6 @@ PLyUnicode_AsString(PyObject *unicode)
return rv;
}
-#if PY_MAJOR_VERSION >= 3
/*
* Convert a C string in the PostgreSQL server encoding to a Python
* unicode object. Reference ownership is passed to the caller.
@@ -126,5 +119,3 @@ PLyUnicode_FromString(const char *s)
{
return PLyUnicode_FromStringAndSize(s, strlen(s));
}
-
-#endif /* PY_MAJOR_VERSION >= 3 */