summaryrefslogtreecommitdiff
path: root/psycopg/adapter_pboolean.c
diff options
context:
space:
mode:
Diffstat (limited to 'psycopg/adapter_pboolean.c')
-rw-r--r--psycopg/adapter_pboolean.c9
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 *