summary refs log tree commit diff
path: root/synapse/http/client.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-06-17 14:38:15 +0100
committerErik Johnston <erik@matrix.org>2020-06-17 14:38:15 +0100
commit8ba10868011ad7d4a48f5d61cbe3326dc8d4ea47 (patch)
tree8c9a40281198725bb690889a1d659104d1c7f70e /synapse/http/client.py
parentMerge branch 'release-v1.15.1' into matrix-org-hotfixes (diff)
parentAdd support for using rust-python-jaeger-reporter (#7697) (diff)
downloadsynapse-8ba10868011ad7d4a48f5d61cbe3326dc8d4ea47.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/http/client.py')
-rw-r--r--synapse/http/client.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py

index 3cef747a4d..8743e9839d 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py
@@ -15,11 +15,9 @@ # limitations under the License. import logging +import urllib from io import BytesIO -from six import raise_from, text_type -from six.moves import urllib - import treq from canonicaljson import encode_canonical_json, json from netaddr import IPAddress @@ -577,7 +575,7 @@ class SimpleHttpClient(object): # This can happen e.g. because the body is too large. raise except Exception as e: - raise_from(SynapseError(502, ("Failed to download remote body: %s" % e)), e) + raise SynapseError(502, ("Failed to download remote body: %s" % e)) from e return ( length, @@ -638,7 +636,7 @@ def encode_urlencode_args(args): def encode_urlencode_arg(arg): - if isinstance(arg, text_type): + if isinstance(arg, str): return arg.encode("utf-8") elif isinstance(arg, list): return [encode_urlencode_arg(i) for i in arg]