diff --git a/cime_config/buildlib b/cime_config/buildlib index 3bea6a47..292984e6 100755 --- a/cime_config/buildlib +++ b/cime_config/buildlib @@ -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: diff --git a/cime_config/buildlib_2.1 b/cime_config/buildlib_2.1 index b36dc37d..cff7f585 100755 --- a/cime_config/buildlib_2.1 +++ b/cime_config/buildlib_2.1 @@ -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: @@ -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 diff --git a/cime_config/buildlib_2.2 b/cime_config/buildlib_2.2 index ec30963c..a7daa07f 100755 --- a/cime_config/buildlib_2.2 +++ b/cime_config/buildlib_2.2 @@ -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: @@ -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