Skip to content

Commit

Permalink
fix: use dict.get with default empty
Browse files Browse the repository at this point in the history
Co-authored-by: Andre Sailer <[email protected]>
  • Loading branch information
wdconinc and andresailer authored Feb 6, 2024
1 parent e5834cf commit e166b19
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions DDG4/python/DDSim/DD4hepSimulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,8 @@ def run(self):
(self.action.stack, DDG4.StackingAction, kernel.stackingAction)]:
for action_dict in action_list:
action = DDG4_Action(kernel, action_dict["name"])
if 'parameter' in action_dict.keys():
for parameter, value in action_dict['parameter'].items():
setattr(action, parameter, value)
for parameter, value in action_dict.get('parameter', {}).items():
setattr(action, parameter, value)
kernel_Action().add(action)

# ----------------------------------------------------------------------------------
Expand Down

0 comments on commit e166b19

Please sign in to comment.