Skip to content

Commit f79dffc

Browse files
committed
chore: no-op exception suppress
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
1 parent abefc8c commit f79dffc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

aws_lambda_powertools/event_handler/middlewares/openapi_validation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import contextlib
12
import dataclasses
23
import json
34
import logging
@@ -385,12 +386,10 @@ def _normalize_multi_query_string_with_param(query_string: Optional[Dict[str, st
385386
"""
386387
if query_string:
387388
for param in filter(is_scalar_field, params):
388-
try:
389+
with contextlib.suppress(KeyError):
389390
# if the target parameter is a scalar, we keep the first value of the query string
390391
# regardless if there are more in the payload
391392
query_string[param.alias] = query_string[param.alias][0]
392-
except KeyError:
393-
pass
394393
return query_string
395394

396395

0 commit comments

Comments
 (0)