Fix for importlib has no attribute util

LT1AB
piyushrpt 2019-07-19 01:15:10 -07:00
parent 77aa07640a
commit 8345318434
3 changed files with 6 additions and 6 deletions

View File

@ -98,9 +98,9 @@ def main(factoryFile,package,buildDir):
# import isce
import filecmp
try:
import importlib
from importlib import util
factoryFile = os.path.abspath(factoryFile)
mod = importlib.util.spec_from_file_location('.', factoryFile)
mod = util.spec_from_file_location('.', factoryFile)
factModule = mod.loader.load_module()
factoriesInfo = factModule.getFactoriesInfo()
nameList = []

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
import os, sys
import importlib
from importlib import util as importlibutil
import argparse
import configparser
@ -95,7 +95,7 @@ class ConfigParser:
# If any of the following calls raises an exception,
# there's a problem we can't handle -- let the caller handle it.
spec = importlib.util.find_spec(name)
spec = importlibutil.find_spec(name)
try:
return spec.loader.load_module()

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
import os, sys
import importlib
from importlib import util as importlibutil
import argparse
import configparser
@ -158,7 +158,7 @@ class ConfigParser:
# If any of the following calls raises an exception,
# there's a problem we can't handle -- let the caller handle it.
spec = importlib.util.find_spec(name)
spec = importlibutil.find_spec(name)
try:
return spec.loader.load_module()