Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusFrankATcernch authored Dec 14, 2023
2 parents 3cbc7dd + 530670e commit eb92ede
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions DDCore/python/dd4hep_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
# ==========================================================================
from __future__ import absolute_import, unicode_literals
import cppyy
import imp
import importlib
import types
import logging


Expand All @@ -35,8 +36,8 @@ def compileAClick(dictionary, g4=True):
gSystem.AddIncludePath(inc)
gSystem.AddLinkedLibs(lib)
logger.info('Loading AClick %s', dictionary)
package = imp.find_module('DDG4')
dic = os.path.dirname(package[1]) + os.sep + dictionary
package_spec = importlib.util.find_spec('DDG4')
dic = os.path.dirname(package_spec.origin) + os.sep + dictionary
gInterpreter.ProcessLine('.L ' + dic + '+')
from ROOT import dd4hep as module
return module
Expand Down Expand Up @@ -155,7 +156,7 @@ def unicode_2_string(value):
tools = dd4hep.tools
align = dd4hep.align
detail = dd4hep.detail
units = imp.new_module('units')
units = types.ModuleType('units')
# ---------------------------------------------------------------------------
import_namespace_item('tools', 'Evaluator')
# ---------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions DDDigi/python/dddigi.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def importConstants(description, namespace=None, debug=False):
"""
ns = current
if namespace is not None and not hasattr(current, namespace):
import imp
m = imp.new_module('dddigi.' + namespace)
import types
m = types.ModuleType('dddigi.' + namespace)
setattr(current, namespace, m)
ns = m
evaluator = dd4hep.g4Evaluator()
Expand Down
4 changes: 2 additions & 2 deletions DDG4/python/DDG4.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def importConstants(description, namespace=None, debug=False):
"""
ns = current
if namespace is not None and not hasattr(current, namespace):
import imp
m = imp.new_module('DDG4.' + namespace)
import types
m = types.ModuleType('DDG4.' + namespace)
setattr(current, namespace, m)
ns = m
evaluator = dd4hep.g4Evaluator()
Expand Down

0 comments on commit eb92ede

Please sign in to comment.