diff options
author | David Baker <dave@matrix.org> | 2016-03-08 10:09:07 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2016-03-08 10:09:07 +0000 |
commit | 9a3c80a348b850a04e257b30ce41f0a7c453594b (patch) | |
tree | 3454b212273adfb49749a0b07aa1d01a3435ea93 | |
parent | Encode unicode objects given to post_urlencode* otherwise urllib.urlencode ch... (diff) | |
download | synapse-9a3c80a348b850a04e257b30ce41f0a7c453594b.tar.xz |
pep8
Diffstat (limited to '')
-rw-r--r-- | synapse/http/client.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py index b3cd5ff26a..cbd45b2bbe 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py @@ -268,17 +268,20 @@ class CaptchaServerHttpClient(SimpleHttpClient): # twisted dislikes google's response, no content length. defer.returnValue(e.response) + def encode_urlencode_args(args): - return { k: encode_urlencode_arg(v) for k, v in args.items() } + return {k: encode_urlencode_arg(v) for k, v in args.items()} + def encode_urlencode_arg(arg): if isinstance(arg, unicode): return arg.encode('utf-8') elif isinstance(arg, list): - return [ encode_urlencode_arg(i) for i in arg ] + return [encode_urlencode_arg(i) for i in arg] else: return arg + def _print_ex(e): if hasattr(e, "reasons") and e.reasons: for ex in e.reasons: |