diff options
author | Adrian Tschira <nota@notafile.com> | 2018-04-15 21:43:35 +0200 |
---|---|---|
committer | Adrian Tschira <nota@notafile.com> | 2018-05-19 17:56:31 +0200 |
commit | d9fe2b2d9dbb539da32f969b8bd752159fd5eb6f (patch) | |
tree | ed9440ba4276d0a6aba07c6560fa19b4e0a25be0 /synapse/http | |
parent | Merge pull request #3241 from matrix-org/fix_user_visits_insertion (diff) | |
download | synapse-d9fe2b2d9dbb539da32f969b8bd752159fd5eb6f.tar.xz |
Replace some more comparisons with six
plus a bonus b"" string I missed last time Signed-off-by: Adrian Tschira <nota@notafile.com>
Diffstat (limited to 'synapse/http')
-rw-r--r-- | synapse/http/matrixfederationclient.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 4b2b85464d..4650f43029 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -42,6 +42,8 @@ import random import sys import urllib from six.moves.urllib import parse as urlparse +from six import string_types + logger = logging.getLogger(__name__) outbound_logger = logging.getLogger("synapse.http.outbound") @@ -553,7 +555,7 @@ class MatrixFederationHttpClient(object): encoded_args = {} for k, vs in args.items(): - if isinstance(vs, basestring): + if isinstance(vs, string_types): vs = [vs] encoded_args[k] = [v.encode("UTF-8") for v in vs] @@ -668,7 +670,7 @@ def check_content_type_is_json(headers): RuntimeError if the """ - c_type = headers.getRawHeaders("Content-Type") + c_type = headers.getRawHeaders(b"Content-Type") if c_type is None: raise RuntimeError( "No Content-Type header" @@ -685,7 +687,7 @@ def check_content_type_is_json(headers): def encode_query_args(args): encoded_args = {} for k, vs in args.items(): - if isinstance(vs, basestring): + if isinstance(vs, string_types): vs = [vs] encoded_args[k] = [v.encode("UTF-8") for v in vs] |