summaryrefslogtreecommitdiff
path: root/psycopg/python.h
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2013-04-07 17:43:35 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2013-04-07 17:43:35 +0100
commit80e105c74d1846b036eccf14adad8dbc95dce39c (patch)
tree6c9699513fe724e0e16bee254945fa6482a36c2f /psycopg/python.h
parent7a1d1791d3f70be4ebe7eccb7ec50732589c3dcf (diff)
parentb448f822f48885fcb3caa48f213bec54cf886ec0 (diff)
downloadpsycopg2-80e105c74d1846b036eccf14adad8dbc95dce39c.tar.gz
Merge branch 'devel'2_5
Diffstat (limited to 'psycopg/python.h')
-rw-r--r--psycopg/python.h34
1 files changed, 3 insertions, 31 deletions
diff --git a/psycopg/python.h b/psycopg/python.h
index f6d6be0..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"
@@ -114,6 +85,7 @@ typedef unsigned long Py_uhash_t;
#define PyInt_AsLong PyLong_AsLong
#define PyInt_FromLong PyLong_FromLong
#define PyInt_FromSsize_t PyLong_FromSsize_t
+#define PyExc_StandardError PyExc_Exception
#define PyString_FromFormat PyUnicode_FromFormat
#define Py_TPFLAGS_HAVE_ITER 0L
#define Py_TPFLAGS_HAVE_RICHCOMPARE 0L