The hell with 'pythonic try/except' ... Just use a goddamn if/else for that kind of stuff

This commit is contained in:
Alexandre Aubin 2020-04-23 04:26:00 +02:00
parent db29a9aa38
commit 6f1133b205

View file

@ -327,11 +327,10 @@ class _ActionsMapPlugin(object):
# Append other request params
for k, v in request.params.dict.items():
v = _format(v)
try:
curr_v = params[k]
except KeyError:
if k not in params.keys():
params[k] = v
else:
curr_v = params[k]
# Append param value to the list
if not isinstance(curr_v, list):
curr_v = [curr_v]