Skip to content

Commit

Permalink
Merge pull request #412 from mvertens/feature/update_buildlib
Browse files Browse the repository at this point in the history
replaced imp.load_source with importlib.machinery.SourceFileLoader
  • Loading branch information
TomasTorsvik authored Oct 16, 2024
2 parents 816981a + 7ec2942 commit cbca1a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cime_config/buildlib
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
build blom library
"""
import os, shutil, sys, glob, imp
import os, sys

_CIMEROOT = os.environ.get("CIMEROOT")
if _CIMEROOT is None:
Expand Down
5 changes: 3 additions & 2 deletions cime_config/buildlib_2.1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"""
build blom library
"""
import os, shutil, sys, glob, imp
import os, shutil, sys, glob
from importlib.machinery import SourceFileLoader

_CIMEROOT = os.environ.get("CIMEROOT")
if _CIMEROOT is None:
Expand Down Expand Up @@ -32,7 +33,7 @@ def _main_func():
cmd = os.path.join(os.path.join(comp_root_dir_ocn, "cime_config", "buildcpp"))
logger.info(" ...calling blom buildcpp to set build time options")
try:
mod = imp.load_source("buildcpp", cmd)
mod = SourceFileLoader("buildcpp", cmd).load_module()
blom_cppdefs = mod.buildcpp(case)
except:
raise
Expand Down
5 changes: 3 additions & 2 deletions cime_config/buildlib_2.2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"""
build blom library
"""
import os, shutil, sys, glob, imp
import os, shutil, sys, glob
from importlib.machinery import SourceFileLoader

_CIMEROOT = os.environ.get("CIMEROOT")
if _CIMEROOT is None:
Expand Down Expand Up @@ -33,7 +34,7 @@ def _main_func():
cmd = os.path.join(os.path.join(comp_root_dir_ocn, "cime_config", "buildcpp"))
logger.info(" ...calling blom buildcpp to set build time options")
try:
mod = imp.load_source("buildcpp", cmd)
mod = SourceFileLoader("buildcpp", cmd).load_module()
blom_cppdefs = mod.buildcpp(case)
except:
raise
Expand Down

0 comments on commit cbca1a6

Please sign in to comment.