20 At this point this function just makes sure the ROOT batch mode is set
21 correctly when someone imports ROOT
23 from AthenaCommon.Logging
import log
24 import builtins
as builtin_mod
25 oldimporthook = builtin_mod.__import__
26 batch_mode = bool(batch)
28 def root6_importhook(name, globals={}, locals={}, fromlist=[], level=0):
32 if name==
'ROOT' or (name[0:4]==
'ROOT' and name!=
'ROOT.pythonization'):
36 m = oldimporthook(name, globals, locals, fromlist, level)
39 log.debug(
'Python import module=%s, fromlist=%s', name, fromlist)
41 log.debug(
'Setting ROOT batch mode to %s', bm)
46 builtin_mod.__import__ = root6_importhook