diff options
| author | James Henstridge <james@jamesh.id.au> | 2008-05-05 10:22:22 +0800 |
|---|---|---|
| committer | James Henstridge <james@jamesh.id.au> | 2008-05-05 10:22:22 +0800 |
| commit | 31ef9355c21a45d62fdb01293863fe26cd33109a (patch) | |
| tree | 83e24186396b58e504178c152197cbf0560f7ee4 /psycopg/psycopgmodule.c | |
| parent | 5689f07de49af1b716b68efd9eaed63bd2f6af8c (diff) | |
| parent | 96f631d41e302ba5add0987ec4a2be1963a64b37 (diff) | |
| download | psycopg2-31ef9355c21a45d62fdb01293863fe26cd33109a.tar.gz | |
Merge psycopg2/trunk into psycopg2/branches/2_0_x r243 (which is the
last revision merged into trunk). Where file ID conflicts exist, but
the content was equivalent, I've picked the 2_0_x version.
Diffstat (limited to 'psycopg/psycopgmodule.c')
| -rw-r--r-- | psycopg/psycopgmodule.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c index 5f37856..b4ea5cb 100644 --- a/psycopg/psycopgmodule.c +++ b/psycopg/psycopgmodule.c @@ -27,6 +27,7 @@ #include "psycopg/psycopg.h" #include "psycopg/connection.h" #include "psycopg/cursor.h" +#include "psycopg/lobject.h" #include "psycopg/typecast.h" #include "psycopg/microprotocols.h" #include "psycopg/microprotocols_proto.h" @@ -551,7 +552,7 @@ init_psycopg(void) asisType.ob_type = &PyType_Type; listType.ob_type = &PyType_Type; chunkType.ob_type = &PyType_Type; - + if (PyType_Ready(&connectionType) == -1) return; if (PyType_Ready(&cursorType) == -1) return; if (PyType_Ready(&typecastType) == -1) return; @@ -562,6 +563,11 @@ init_psycopg(void) if (PyType_Ready(&listType) == -1) return; if (PyType_Ready(&chunkType) == -1) return; +#ifdef PSYCOPG_EXTENSIONS + lobjectType.ob_type = &PyType_Type; + if (PyType_Ready(&lobjectType) == -1) return; +#endif + #ifdef HAVE_PYBOOL pbooleanType.ob_type = &PyType_Type; if (PyType_Ready(&pbooleanType) == -1) return; @@ -638,7 +644,10 @@ init_psycopg(void) PyModule_AddObject(module, "connection", (PyObject*)&connectionType); PyModule_AddObject(module, "cursor", (PyObject*)&cursorType); PyModule_AddObject(module, "ISQLQuote", (PyObject*)&isqlquoteType); - +#ifdef PSYCOPG_EXTENSIONS + PyModule_AddObject(module, "lobject", (PyObject*)&lobjectType); +#endif + /* encodings dictionary in module dictionary */ PyModule_AddObject(module, "encodings", psycoEncodings); @@ -664,6 +673,10 @@ init_psycopg(void) listType.tp_alloc = PyType_GenericAlloc; chunkType.tp_alloc = PyType_GenericAlloc; +#ifdef PSYCOPG_EXTENSIONS + lobjectType.tp_alloc = PyType_GenericAlloc; +#endif + #ifdef HAVE_PYDATETIME pydatetimeType.tp_alloc = PyType_GenericAlloc; #endif |
