Merge pull request #242 from YunoHost/fix-weird-try-except

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-25 23:56:59 +02:00 committed by GitHub
commit c9952acc8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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]