Skip to content

InDetPhysValMonitoring use absolute import to fix crash in py3

InDetPhysValMonitoring ART fails in python 3 with

09:26:31 Initialization of InDetFlags finished - locking container!
09:26:31 Py:JobPropertyContainer::    INFO The JobProperty Container InDetPhysValJobProperties is locked
09:26:31 Shortened traceback (most recent user call last):
09:26:31   File "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master--py3_Athena_x86_64-centos7-gcc8-opt/2020-06-13T2135/Athena/22.0.15/InstallArea/x86_64-centos7-gcc8-opt/jobOptions/PATJobTransforms/skeleton.PhysicsValidation_tf.py", line 135, in <module>
09:26:31     include ("RecExCommon/RecExCommon_topOptions.py")
09:26:31   File "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master--py3_Athena_x86_64-centos7-gcc8-opt/2020-06-13T2135/Athena/22.0.15/InstallArea/x86_64-centos7-gcc8-opt/jobOptions/RecExCommon/RecExCommon_topOptions.py", line 749, in <module>
09:26:31     include (UserAlg)
09:26:31   File "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master--py3_Athena_x86_64-centos7-gcc8-opt/2020-06-13T2135/Athena/22.0.15/InstallArea/x86_64-centos7-gcc8-opt/jobOptions/PhysValMonitoring/PhysValInDet_jobOptions.py", line 7, in <module>
09:26:31     import InDetPhysValMonitoring.InDetPhysValMonitoringTool as InDetPhysValMonitoringTool
09:26:31   File "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master--py3_Athena_x86_64-centos7-gcc8-opt/sw/lcg/releases/LCG_97python3/ROOT/v6.20.02/x86_64-centos7-gcc8-opt/lib/ROOT.py", line 522, in _importhook
09:26:31     return _orig_ihook( name, *args, **kwds )
09:26:31   File "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master--py3_Athena_x86_64-centos7-gcc8-opt/2020-06-13T2135/Athena/22.0.15/InstallArea/x86_64-centos7-gcc8-opt/python/PyUtils/Helpers.py", line 32, in root6_importhook
09:26:31     m = oldimporthook(name, globals, locals, fromlist, level)
09:26:31   File "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master--py3_Athena_x86_64-centos7-gcc8-opt/2020-06-13T2135/Athena/22.0.15/InstallArea/x86_64-centos7-gcc8-opt/python/InDetPhysValMonitoring/InDetPhysValMonitoringTool.py", line 4, in <module>
09:26:31     from ConfigUtils import serviceFactory,toolFactory
09:26:31   File "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master--py3_Athena_x86_64-centos7-gcc8-opt/sw/lcg/releases/LCG_97python3/ROOT/v6.20.02/x86_64-centos7-gcc8-opt/lib/ROOT.py", line 522, in _importhook
09:26:31     return _orig_ihook( name, *args, **kwds )
09:26:31   File "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master--py3_Athena_x86_64-centos7-gcc8-opt/2020-06-13T2135/Athena/22.0.15/InstallArea/x86_64-centos7-gcc8-opt/python/PyUtils/Helpers.py", line 32, in root6_importhook
09:26:31     m = oldimporthook(name, globals, locals, fromlist, level)
09:26:31 
09:26:31 ModuleNotFoundError: No module named 'ConfigUtils'

Added an absolute import of ConfigUtils and tested in py3 and default setup. Seems to work as expected locally and not cause any new issues for the default.

FYI: @sroe @goetz @goblirsc @keli

Merge request reports