mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-27 03:58:06 +03:00
pep8
This commit is contained in:
parent
7bcee4733a
commit
9a3c80a348
1 changed files with 5 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue