summary refs log tree commit diff
path: root/scripts-dev/convert_server_keys.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-05-18 10:45:30 +0100
committerGitHub <noreply@github.com>2020-05-18 10:45:30 +0100
commit4d1afb1dfe678898322479e229b3d51cc33c3fd2 (patch)
tree0aa0009fc0f1c8ca09f4379810ac71a34e0ee775 /scripts-dev/convert_server_keys.py
parentfix mypy for tests/replication (#7518) (diff)
parentchangelog (diff)
downloadsynapse-4d1afb1dfe678898322479e229b3d51cc33c3fd2.tar.xz
Merge pull request #7519 from matrix-org/rav/kill_py2_code
Kill off some old python 2 code
Diffstat (limited to 'scripts-dev/convert_server_keys.py')
-rw-r--r--scripts-dev/convert_server_keys.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/scripts-dev/convert_server_keys.py b/scripts-dev/convert_server_keys.py
index 06b4c1e2ff..961dc59f11 100644
--- a/scripts-dev/convert_server_keys.py
+++ b/scripts-dev/convert_server_keys.py
@@ -3,8 +3,6 @@ import json
 import sys
 import time
 
-import six
-
 import psycopg2
 import yaml
 from canonicaljson import encode_canonical_json
@@ -12,10 +10,7 @@ from signedjson.key import read_signing_keys
 from signedjson.sign import sign_json
 from unpaddedbase64 import encode_base64
 
-if six.PY2:
-    db_type = six.moves.builtins.buffer
-else:
-    db_type = memoryview
+db_binary_type = memoryview
 
 
 def select_v1_keys(connection):
@@ -72,7 +67,7 @@ def rows_v2(server, json):
     valid_until = json["valid_until_ts"]
     key_json = encode_canonical_json(json)
     for key_id in json["verify_keys"]:
-        yield (server, key_id, "-", valid_until, valid_until, db_type(key_json))
+        yield (server, key_id, "-", valid_until, valid_until, db_binary_type(key_json))
 
 
 def main():