summaryrefslogtreecommitdiff
path: root/psycopg/python.h
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2013-03-20 23:40:13 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2013-03-20 23:40:13 +0000
commitb6873ee1ab9c38d446508e64a18b44c20951502d (patch)
treea9d1ee82a42252331df9a1a3b39b779dbf0e1fc1 /psycopg/python.h
parente65392e0d87c601822c51c50c803eab58f1508d3 (diff)
downloadpsycopg2-b6873ee1ab9c38d446508e64a18b44c20951502d.tar.gz
Dropped support for Python 2.4
Diffstat (limited to 'psycopg/python.h')
-rw-r--r--psycopg/python.h33
1 files changed, 2 insertions, 31 deletions
diff --git a/psycopg/python.h b/psycopg/python.h
index 9fce6e1..90c8251 100644
--- a/psycopg/python.h
+++ b/psycopg/python.h
@@ -31,36 +31,12 @@
#include <stringobject.h>
#endif
-#if PY_VERSION_HEX < 0x02040000
-# error "psycopg requires Python >= 2.4"
-#endif
-
#if PY_VERSION_HEX < 0x02050000
-/* Function missing in Py 2.4 */
-#define PyErr_WarnEx(cat,msg,lvl) PyErr_Warn(cat,msg)
-#endif
-
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
- typedef int Py_ssize_t;
- #define PY_SSIZE_T_MIN INT_MIN
- #define PY_SSIZE_T_MAX INT_MAX
- #define PY_FORMAT_SIZE_T ""
- #define PyInt_FromSsize_t(x) PyInt_FromLong((x))
-
- #define lenfunc inquiry
- #define ssizeargfunc intargfunc
- #define readbufferproc getreadbufferproc
- #define writebufferproc getwritebufferproc
- #define segcountproc getsegcountproc
- #define charbufferproc getcharbufferproc
-
- #define CONV_CODE_PY_SSIZE_T "i"
-#else
- #define CONV_CODE_PY_SSIZE_T "n"
+# error "psycopg requires Python >= 2.5"
#endif
/* hash() return size changed around version 3.2a4 on 64bit platforms. Before
- * this, the return size was always a long, regardless of arch. ~3.2
+ * this, the return size was always a long, regardless of arch. ~3.2
* introduced the Py_hash_t & Py_uhash_t typedefs with the resulting sizes
* based upon arch. */
#if PY_VERSION_HEX < 0x030200A4
@@ -76,11 +52,6 @@ typedef unsigned long Py_uhash_t;
#define PyVarObject_HEAD_INIT(x,n) PyObject_HEAD_INIT(x) n,
#endif
-/* Missing at least in Python 2.4 */
-#ifndef Py_MEMCPY
-#define Py_MEMCPY memcpy
-#endif
-
/* FORMAT_CODE_PY_SSIZE_T is for Py_ssize_t: */
#define FORMAT_CODE_PY_SSIZE_T "%" PY_FORMAT_SIZE_T "d"