Skip to content
Snippets Groups Projects
Commit a5431ff3 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'xmlcrash.importhook.fix' into 'master'

prevent importhook triggering on just 'import ROOT'; see ATEAM-597

See merge request !31320
parents fc0f39a5 a02d52e1
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!31320prevent importhook triggering on just 'import ROOT'; see ATEAM-597
...@@ -28,7 +28,8 @@ def ROOT6Setup(): ...@@ -28,7 +28,8 @@ def ROOT6Setup():
def root6_importhook(name, globals={}, locals={}, fromlist=[], level=-1): def root6_importhook(name, globals={}, locals={}, fromlist=[], level=-1):
if six.PY3 and level < 0: level = 0 if six.PY3 and level < 0: level = 0
m = oldimporthook(name, globals, locals, fromlist, level) m = oldimporthook(name, globals, locals, fromlist, level)
if m and (m.__name__== 'ROOT' or name[0:4]=='ROOT'): if m and (m.__name__== 'ROOT' or name[0:4]=='ROOT') \
and (name!='ROOT' or fromlist!=None): # prevent triggering on just 'import ROOT'; see ATEAM-597
log.debug('Python import module=%s fromlist=%s'%(name, str(fromlist))) log.debug('Python import module=%s fromlist=%s'%(name, str(fromlist)))
if fromlist: if fromlist:
#MN: in this case 'm' is the final nested module already, don't walk the full 'name' #MN: in this case 'm' is the final nested module already, don't walk the full 'name'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment