mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
use memoryview in py3
Signed-off-by: Adrian Tschira <nota@notafile.com>
This commit is contained in:
parent
235b53263a
commit
1afafb3497
2 changed files with 18 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue