summaryrefslogtreecommitdiff
path: root/psycopg/adapter_binary.c
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-02-15 17:30:43 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-02-15 17:30:43 +0000
commit3ae2f221b38719ccd9c91321b0031c0b1d68a9d6 (patch)
treec58ea79305266e67ead44d978cdadaf75d619742 /psycopg/adapter_binary.c
parentc96ba553dadd921b9e1e0b3d66092a4182036a55 (diff)
downloadpsycopg2-3ae2f221b38719ccd9c91321b0031c0b1d68a9d6.tar.gz
Adapt bytearray and memoryview to bytes if available
Diffstat (limited to 'psycopg/adapter_binary.c')
-rw-r--r--psycopg/adapter_binary.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/psycopg/adapter_binary.c b/psycopg/adapter_binary.c
index d54d17a..31b2502 100644
--- a/psycopg/adapter_binary.c
+++ b/psycopg/adapter_binary.c
@@ -61,8 +61,11 @@ binary_quote(binaryObject *self)
if (Bytes_Check(self->wrapped)
#if PY_MAJOR_VERSION < 3
|| PyBuffer_Check(self->wrapped)
-#else
+#endif
+#if PY_MAJOR_VERSION >= 3 || PY_MINOR_VERSION >= 6
|| PyByteArray_Check(self->wrapped)
+#endif
+#if PY_MAJOR_VERSION >= 3 || PY_MINOR_VERSION >= 7
|| PyMemoryView_Check(self->wrapped)
#endif
) {