Skip to content

Commit

Permalink
Make debugging a bit easier
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Feb 14, 2024
1 parent 39648dd commit 02a687a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions k4FWCore/python/k4FWCore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def import_from(
"""
filename = os.path.abspath(filename)
if not os.path.exists(filename):
raise FileNotFoundError(f"No such file: '{filename}'")

module_name = module_name or os.path.basename(filename).replace(".", "_")
loader = SourceFileLoader(module_name, filename)
spec = importlib.util.spec_from_loader(loader.name, loader)
Expand Down

0 comments on commit 02a687a

Please sign in to comment.