From 6e67fbf079d05c25f7b1bcc2a6ee950ff8656a49 Mon Sep 17 00:00:00 2001 From: Tim Martin <Tim.Martin@cern.ch> Date: Wed, 12 Aug 2020 11:08:42 +0200 Subject: [PATCH] Do not use bare except --- Tools/PyUtils/python/MetaReader.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Tools/PyUtils/python/MetaReader.py b/Tools/PyUtils/python/MetaReader.py index 50ba9c72799..ee7fb225fcc 100644 --- a/Tools/PyUtils/python/MetaReader.py +++ b/Tools/PyUtils/python/MetaReader.py @@ -596,17 +596,18 @@ def _extract_fields_ef(value): def _extract_fields_triggermenu(interface, aux): L1Items = [] HLTChains = [] - import traceback try: interface.setStore( aux ) if interface.size() > 0: + # We make the assumption that the first stored SMK is + # representative of all events in the input collection. firstMenu = interface.at(0) - L1Items = [ item for item in firstMenu.itemNames()] - HLTChains = [ chain for chain in firstMenu.chainNames()] - except: - msg.warn('Problem reading xAOD::TriggerMenu, traceback follows:') - msg.warn(traceback.format_exc()) + L1Items = [ item for item in firstMenu.itemNames() ] + HLTChains = [ chain for chain in firstMenu.chainNames() ] + except Exception as err: + msg.warn('Problem reading xAOD::TriggerMenu:') + msg.warn(err) result = {} result['L1Items'] = L1Items -- GitLab