diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-08-31 00:19:58 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-31 00:19:58 +1000 |
commit | 14e4d4f4bf894f4e70118e03f4f4575e1eb6dab6 (patch) | |
tree | 1c7ba21ab2ebe5dbf4c7c15b0b89376fda865c31 /synapse/storage/transactions.py | |
parent | Merge pull request #3764 from matrix-org/rav/close_db_conn_after_init (diff) | |
download | synapse-14e4d4f4bf894f4e70118e03f4f4575e1eb6dab6.tar.xz |
Port storage/ to Python 3 (#3725)
Diffstat (limited to 'synapse/storage/transactions.py')
-rw-r--r-- | synapse/storage/transactions.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/storage/transactions.py b/synapse/storage/transactions.py index 428e7fa36e..0c42bd3322 100644 --- a/synapse/storage/transactions.py +++ b/synapse/storage/transactions.py @@ -18,14 +18,14 @@ from collections import namedtuple import six -from canonicaljson import encode_canonical_json, json +from canonicaljson import encode_canonical_json from twisted.internet import defer from synapse.metrics.background_process_metrics import run_as_background_process from synapse.util.caches.descriptors import cached -from ._base import SQLBaseStore +from ._base import SQLBaseStore, db_to_json # py2 sqlite has buffer hardcoded as only binary type, so we must use it, # despite being deprecated and removed in favor of memoryview @@ -95,7 +95,8 @@ class TransactionStore(SQLBaseStore): ) if result and result["response_code"]: - return result["response_code"], json.loads(str(result["response_json"])) + return result["response_code"], db_to_json(result["response_json"]) + else: return None |