diff options
author | Richard van der Hoff <richard@matrix.org> | 2020-05-15 19:26:54 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2020-05-15 19:37:41 +0100 |
commit | e6027562e2a1964bcaa0163f1615ab72bfc6630b (patch) | |
tree | edf4515f6d1c09da83dc84eba2e5893e2252b627 /synapse/storage/data_stores | |
parent | remove redundant `__func__` (diff) | |
download | synapse-e6027562e2a1964bcaa0163f1615ab72bfc6630b.tar.xz |
remove `builtins.buffer` code from storage code
this is no longer needed on python 3
Diffstat (limited to 'synapse/storage/data_stores')
-rw-r--r-- | synapse/storage/data_stores/main/keys.py | 10 | ||||
-rw-r--r-- | synapse/storage/data_stores/main/transactions.py | 9 |
2 files changed, 3 insertions, 16 deletions
diff --git a/synapse/storage/data_stores/main/keys.py b/synapse/storage/data_stores/main/keys.py index ba89c68c9f..4e1642a27a 100644 --- a/synapse/storage/data_stores/main/keys.py +++ b/synapse/storage/data_stores/main/keys.py @@ -17,8 +17,6 @@ import itertools import logging -import six - from signedjson.key import decode_verify_key_bytes from synapse.storage._base import SQLBaseStore @@ -28,12 +26,8 @@ from synapse.util.iterutils import batch_iter 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 = six.moves.builtins.buffer -else: - db_binary_type = memoryview + +db_binary_type = memoryview class KeyStore(SQLBaseStore): diff --git a/synapse/storage/data_stores/main/transactions.py b/synapse/storage/data_stores/main/transactions.py index 5b07c2fbc0..a9bf457939 100644 --- a/synapse/storage/data_stores/main/transactions.py +++ b/synapse/storage/data_stores/main/transactions.py @@ -16,8 +16,6 @@ import logging from collections import namedtuple -import six - from canonicaljson import encode_canonical_json from twisted.internet import defer @@ -27,12 +25,7 @@ from synapse.storage._base import SQLBaseStore, db_to_json from synapse.storage.database import Database from synapse.util.caches.expiringcache import ExpiringCache -# 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 = six.moves.builtins.buffer -else: - db_binary_type = memoryview +db_binary_type = memoryview logger = logging.getLogger(__name__) |