diff --git a/docs/sphinx-docs/build_sphinx.py b/docs/sphinx-docs/build_sphinx.py index 263f2a3fc9..ce354840ba 100755 --- a/docs/sphinx-docs/build_sphinx.py +++ b/docs/sphinx-docs/build_sphinx.py @@ -12,7 +12,7 @@ import os from os.path import join as joinpath, abspath, dirname, isdir, exists, relpath import shutil -import imp +from importlib.machinery import SourceFileLoader from glob import glob from distutils.dir_util import copy_tree @@ -73,7 +73,7 @@ BUMPS_TARGET = joinpath(SPHINX_PERSPECTIVES, "Fitting") -run = imp.load_source('run', joinpath(SASVIEW_ROOT, 'run.py')) +run = SourceFileLoader('run', joinpath(SASVIEW_ROOT, 'run.py')).load_module() run.prepare() diff --git a/src/sas/qtgui/MainWindow/PackageGatherer.py b/src/sas/qtgui/MainWindow/PackageGatherer.py index 2f4a634f35..497606461a 100644 --- a/src/sas/qtgui/MainWindow/PackageGatherer.py +++ b/src/sas/qtgui/MainWindow/PackageGatherer.py @@ -86,7 +86,7 @@ def get_imported_packages(self): 'dis', 'distutils', 'doctest', 'email', 'encodings', 'ensurepip', 'enum', 'filecmp', 'fileinput', 'fnmatch', 'formatter', 'fractions', 'ftplib', 'functools', 'genericpath', 'getopt', 'getpass', 'gettext', 'glob', 'graphlib', 'gzip', 'hashlib', 'heapq', 'hmac', - 'html', 'http', 'idlelib', 'imaplib', 'imghdr', 'imp', 'importlib', 'inspect', 'io', + 'html', 'http', 'idlelib', 'imaplib', 'imghdr', 'importlib', 'inspect', 'io', 'ipaddress', 'json', 'keyword', 'lib2to3', 'linecache', 'locale', 'logging', 'lzma', 'mailbox', 'mailcap', 'mimetypes', 'modulefinder', 'msilib', 'multiprocessing', 'netrc', 'nntplib', 'ntpath', 'nturl2path', 'numbers', 'opcode', 'operator', 'optparse', 'os', diff --git a/src/sas/qtgui/Utilities/GuiUtils.py b/src/sas/qtgui/Utilities/GuiUtils.py index eb25a44900..b04db50d16 100644 --- a/src/sas/qtgui/Utilities/GuiUtils.py +++ b/src/sas/qtgui/Utilities/GuiUtils.py @@ -6,7 +6,6 @@ import os import re import sys -import imp import warnings import webbrowser import urllib.parse diff --git a/test/run_one.py b/test/run_one.py index 39d0582558..44954a104e 100755 --- a/test/run_one.py +++ b/test/run_one.py @@ -4,7 +4,7 @@ import sys import xmlrunner import unittest -import imp +from importlib.machinery import SourceFileLoader from os.path import abspath, dirname, split as splitpath, join as joinpath import logging @@ -19,7 +19,7 @@ sys.exit(-1) run_py = joinpath(dirname(dirname(abspath(__file__))), 'run.py') -run = imp.load_source('sasview_run', run_py) +run = SourceFileLoader('sasview_run', run_py).load_module() run.prepare() #print("\n".join(sys.path)) @@ -31,5 +31,5 @@ sys.argv = [sys.argv[0]] os.chdir(test_path) sys.path.insert(0, test_path) -test = imp.load_source('tests',test_file) +test = SourceFileLoader('tests', test_file).load_module() unittest.main(test, testRunner=xmlrunner.XMLTestRunner(output='logs'))