Skip to content

Commit

Permalink
Merge pull request #2807 from SasView/2806-imp-module-deprecation
Browse files Browse the repository at this point in the history
2806: Remove all imports of deprecated imp module
  • Loading branch information
Wojciech Potrzebowski committed Feb 22, 2024
2 parents d35f013 + 3798bcd commit 1c5285b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/sphinx-docs/build_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -63,7 +63,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()


Expand Down
2 changes: 1 addition & 1 deletion src/sas/qtgui/MainWindow/PackageGatherer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion src/sas/qtgui/Utilities/GuiUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import os
import re
import sys
import imp
import warnings
import webbrowser
import urllib.parse
Expand Down
6 changes: 3 additions & 3 deletions test/run_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand All @@ -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'))

0 comments on commit 1c5285b

Please sign in to comment.