Skip to content

Commit

Permalink
replace imp with importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
xivh committed Dec 8, 2023
1 parent 7defc71 commit 09a9e4d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions prisms_jobs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import *

import imp
import importlib
import json
import os
import six
Expand Down Expand Up @@ -72,12 +72,7 @@ def set_software(software_name=None):
import prisms_jobs.interface.slurm as software
else:
try:
f, filename, description = imp.find_module(software_name)
try:
software = imp.load_module(software_name, f, filename, description)
finally:
if f:
f.close()
software = importlib.import_module(software_name)
except:
raise Exception('Unrecognized \'software\': ' + software_name)
global __software
Expand Down

0 comments on commit 09a9e4d

Please sign in to comment.