Merge pull request #50 from piyushrpt/imp

Fix for importlib has no attribute util
LT1AB
piyushrpt 2019-07-22 12:54:48 -07:00 committed by GitHub
commit 0695c24cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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