summary refs log tree commit diff
path: root/synapse/storage/_base.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 /synapse/storage/_base.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 'synapse/storage/_base.py')
-rw-r--r--synapse/storage/_base.py8
1 files changed, 0 insertions, 8 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index 59073c0a42..bfce541ca7 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -19,9 +19,6 @@ import random
 from abc import ABCMeta
 from typing import Any, Optional
 
-from six import PY2
-from six.moves import builtins
-
 from canonicaljson import json
 
 from synapse.storage.database import LoggingTransaction  # noqa: F401
@@ -103,11 +100,6 @@ def db_to_json(db_content):
     if isinstance(db_content, memoryview):
         db_content = db_content.tobytes()
 
-    # psycopg2 on Python 2 returns buffer objects, which we need to cast to
-    # bytes to decode
-    if PY2 and isinstance(db_content, builtins.buffer):
-        db_content = bytes(db_content)
-
     # Decode it to a Unicode string before feeding it to json.loads, so we
     # consistenty get a Unicode-containing object out.
     if isinstance(db_content, (bytes, bytearray)):