summary refs log tree commit diff
path: root/synapse/storage/keys.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage/keys.py')
-rw-r--r--synapse/storage/keys.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/storage/keys.py b/synapse/storage/keys.py
index 0540c2b0b1..e56c464852 100644
--- a/synapse/storage/keys.py
+++ b/synapse/storage/keys.py
@@ -17,6 +17,7 @@ from ._base import SQLBaseStore
 from synapse.util.caches.descriptors import cachedInlineCallbacks
 
 from twisted.internet import defer
+import six
 
 import OpenSSL
 from signedjson.key import decode_verify_key_bytes
@@ -26,6 +27,13 @@ import logging
 
 logger = logging.getLogger(__name__)
 
+# py2 sqlite has buffer hardcoded as only binary type, so we must use it,
+# despite being deprecated and removed in favor of memoryview
+if six.PY2:
+    db_binary_type = buffer
+else:
+    db_binary_type = memoryview
+
 
 class KeyStore(SQLBaseStore):
     """Persistence for signature verification keys and tls X.509 certificates