From 4635c2aa4f41c1fe05ec4d5d562f89eb3c4f9d27 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 13 Dec 2010 02:24:33 +0000 Subject: [PATCH] Import structmember/stringobject headers from python.h. stringobject is not to be imported with Python 3. --- psycopg/adapter_asis.c | 2 -- psycopg/adapter_binary.c | 2 -- psycopg/adapter_datetime.c | 2 -- psycopg/adapter_list.c | 3 --- psycopg/adapter_mxdatetime.c | 2 -- psycopg/adapter_pboolean.c | 2 -- psycopg/adapter_pdecimal.c | 1 - psycopg/adapter_pfloat.c | 1 - psycopg/adapter_qstring.c | 2 -- psycopg/connection_type.c | 3 --- psycopg/cursor_type.c | 1 - psycopg/lobject_type.c | 1 - psycopg/microprotocols.c | 2 -- psycopg/microprotocols_proto.c | 3 --- psycopg/notify_type.c | 2 -- psycopg/python.h | 3 +++ psycopg/typecast.c | 2 -- psycopg/xid_type.c | 2 -- 18 files changed, 3 insertions(+), 33 deletions(-) diff --git a/psycopg/adapter_asis.c b/psycopg/adapter_asis.c index b0e7bc89..0d0a7f67 100644 --- a/psycopg/adapter_asis.c +++ b/psycopg/adapter_asis.c @@ -29,8 +29,6 @@ #include "psycopg/adapter_asis.h" #include "psycopg/microprotocols_proto.h" -#include -#include #include diff --git a/psycopg/adapter_binary.c b/psycopg/adapter_binary.c index ed477b74..cf31ccbf 100644 --- a/psycopg/adapter_binary.c +++ b/psycopg/adapter_binary.c @@ -30,8 +30,6 @@ #include "psycopg/microprotocols_proto.h" #include "psycopg/connection.h" -#include -#include #include diff --git a/psycopg/adapter_datetime.c b/psycopg/adapter_datetime.c index ec1f2d49..f640684a 100644 --- a/psycopg/adapter_datetime.c +++ b/psycopg/adapter_datetime.c @@ -29,8 +29,6 @@ #include "psycopg/adapter_datetime.h" #include "psycopg/microprotocols_proto.h" -#include -#include #include #include diff --git a/psycopg/adapter_list.c b/psycopg/adapter_list.c index 53846182..8bd66881 100644 --- a/psycopg/adapter_list.c +++ b/psycopg/adapter_list.c @@ -30,9 +30,6 @@ #include "psycopg/microprotocols.h" #include "psycopg/microprotocols_proto.h" -#include -#include - /* list_str, list_getquoted - return result of quoting */ diff --git a/psycopg/adapter_mxdatetime.c b/psycopg/adapter_mxdatetime.c index 36ef48a9..793dfba2 100644 --- a/psycopg/adapter_mxdatetime.c +++ b/psycopg/adapter_mxdatetime.c @@ -30,8 +30,6 @@ #include "psycopg/adapter_mxdatetime.h" #include "psycopg/microprotocols_proto.h" -#include -#include #include #include diff --git a/psycopg/adapter_pboolean.c b/psycopg/adapter_pboolean.c index 73284a83..a74d9f37 100644 --- a/psycopg/adapter_pboolean.c +++ b/psycopg/adapter_pboolean.c @@ -29,8 +29,6 @@ #include "psycopg/adapter_pboolean.h" #include "psycopg/microprotocols_proto.h" -#include -#include #include diff --git a/psycopg/adapter_pdecimal.c b/psycopg/adapter_pdecimal.c index c877eaeb..ed79ea1a 100644 --- a/psycopg/adapter_pdecimal.c +++ b/psycopg/adapter_pdecimal.c @@ -29,7 +29,6 @@ #include "psycopg/adapter_pdecimal.h" #include "psycopg/microprotocols_proto.h" -#include #include #include diff --git a/psycopg/adapter_pfloat.c b/psycopg/adapter_pfloat.c index f75424ef..f6ad6361 100644 --- a/psycopg/adapter_pfloat.c +++ b/psycopg/adapter_pfloat.c @@ -29,7 +29,6 @@ #include "psycopg/adapter_pfloat.h" #include "psycopg/microprotocols_proto.h" -#include #include #include diff --git a/psycopg/adapter_qstring.c b/psycopg/adapter_qstring.c index d4338be8..9da6a212 100644 --- a/psycopg/adapter_qstring.c +++ b/psycopg/adapter_qstring.c @@ -30,8 +30,6 @@ #include "psycopg/adapter_qstring.h" #include "psycopg/microprotocols_proto.h" -#include -#include #include diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c index 0f10276a..21e5e8e2 100644 --- a/psycopg/connection_type.c +++ b/psycopg/connection_type.c @@ -33,9 +33,6 @@ #include "psycopg/green.h" #include "psycopg/xid.h" -#include -#include - #include #include diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index 0a398963..cd62d508 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -34,7 +34,6 @@ #include "psycopg/microprotocols.h" #include "psycopg/microprotocols_proto.h" -#include #include #include diff --git a/psycopg/lobject_type.c b/psycopg/lobject_type.c index 29dcddc6..d07becbe 100644 --- a/psycopg/lobject_type.c +++ b/psycopg/lobject_type.c @@ -32,7 +32,6 @@ #include "psycopg/microprotocols_proto.h" #include "psycopg/pqpath.h" -#include #include diff --git a/psycopg/microprotocols.c b/psycopg/microprotocols.c index 8fd3346c..f41d85f1 100644 --- a/psycopg/microprotocols.c +++ b/psycopg/microprotocols.c @@ -31,8 +31,6 @@ #include "psycopg/cursor.h" #include "psycopg/connection.h" -#include - /** the adapters registry **/ diff --git a/psycopg/microprotocols_proto.c b/psycopg/microprotocols_proto.c index d929c569..775889d9 100644 --- a/psycopg/microprotocols_proto.c +++ b/psycopg/microprotocols_proto.c @@ -28,9 +28,6 @@ #include "psycopg/microprotocols_proto.h" -#include -#include - #include diff --git a/psycopg/notify_type.c b/psycopg/notify_type.c index 02873120..3d2308ad 100644 --- a/psycopg/notify_type.c +++ b/psycopg/notify_type.c @@ -28,8 +28,6 @@ #include "psycopg/notify.h" -#include - static const char notify_doc[] = "A notification received from the backend.\n\n" diff --git a/psycopg/python.h b/psycopg/python.h index 6faa5b96..b514c2c6 100644 --- a/psycopg/python.h +++ b/psycopg/python.h @@ -27,6 +27,9 @@ #define PSYCOPG_PYTHON_H 1 #include +#if PY_MAJOR_VERSION < 3 +#include +#endif #if PY_VERSION_HEX < 0x02040000 # error "psycopg requires Python >= 2.4" diff --git a/psycopg/typecast.c b/psycopg/typecast.c index 46b9c9f4..47c3c58b 100644 --- a/psycopg/typecast.c +++ b/psycopg/typecast.c @@ -26,8 +26,6 @@ #define PSYCOPG_MODULE #include "psycopg/psycopg.h" -#include - #include "psycopg/typecast.h" #include "psycopg/cursor.h" diff --git a/psycopg/xid_type.c b/psycopg/xid_type.c index 9aed22ac..b7251359 100644 --- a/psycopg/xid_type.c +++ b/psycopg/xid_type.c @@ -29,8 +29,6 @@ #include "psycopg/xid.h" -#include - static const char xid_doc[] = "A transaction identifier used for two-phase commit.\n\n"