Commit e4236bbd authored by Santi Raffa's avatar Santi Raffa Committed by Hrvoje Ribicic
Browse files

FillDict: do not use exceptions for flow control

While it's generally better to beg for forgiveness than ask for
permission in Python, it's not a good idea to rely on exceptions to
model control flow, especially if the resulting code is simpler.
Signed-off-by: default avatarSanti Raffa <>
Reviewed-by: default avatarHrvoje Ribicic <>
parent a09639d1
......@@ -75,10 +75,8 @@ def FillDict(defaults_dict, custom_dict, skip_keys=None):
if skip_keys:
for k in skip_keys:
if k in ret_dict:
del ret_dict[k]
except KeyError:
return ret_dict
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment