diff options
| author | Federico Di Gregorio <fog@initd.org> | 2006-04-24 05:42:02 +0000 |
|---|---|---|
| committer | Federico Di Gregorio <fog@initd.org> | 2006-04-24 05:42:02 +0000 |
| commit | 3806f9688b0a65ad5dc7d0ba0b52f8c4c2e01bee (patch) | |
| tree | 275e18aac5372d9b677f7bddfbac6500dff8b007 /psycopg/adapter_pboolean.c | |
| parent | b51a03b663e10aa31659d8b5762013092225a68e (diff) | |
| download | psycopg2-3806f9688b0a65ad5dc7d0ba0b52f8c4c2e01bee.tar.gz | |
Boolean fix for arrays.
Diffstat (limited to 'psycopg/adapter_pboolean.c')
| -rw-r--r-- | psycopg/adapter_pboolean.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/psycopg/adapter_pboolean.c b/psycopg/adapter_pboolean.c index 35e534a..fa70ad0 100644 --- a/psycopg/adapter_pboolean.c +++ b/psycopg/adapter_pboolean.c @@ -37,12 +37,21 @@ static PyObject * pboolean_str(pbooleanObject *self) { +#ifdef PSYCOPG_NEW_BOOLEAN + if (PyObject_IsTrue(self->wrapped)) { + return PyString_FromString("true"); + } + else { + return PyString_FromString("false"); + } +#else if (PyObject_IsTrue(self->wrapped)) { return PyString_FromString("'t'"); } else { return PyString_FromString("'f'"); } +#endif } PyObject * |
