diff --git a/ChangeLog.md b/ChangeLog.md index 04f9a6db..0896a582 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -33,6 +33,12 @@ produce the Windows executables and installer. currently used version in a given branch. --- +Release 5.9.3 +=== +This release is identical to 5.9.3, except reverts a bad change. + +- REVERTS Deprecated load_module() is now retired (#1462) + Release 5.9.2 === This release fixes a critical issue on clean installs which would not update the diff --git a/config/__init__.py b/config/__init__.py index e9079c28..44c20465 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.9.2' +_static_appversion = '5.9.3' _cached_version: Optional[semantic_version.Version] = None copyright = '© 2015-2019 Jonathan Harris, 2020-2023 EDCD' diff --git a/plug.py b/plug.py index 58939e3f..fa7807f2 100644 --- a/plug.py +++ b/plug.py @@ -58,10 +58,10 @@ class Plugin(object): try: filename = 'plugin_' filename += name.encode(encoding='ascii', errors='replace').decode('utf-8').replace('.', '_') - spec = importlib.util.spec_from_file_location(filename, loadfile) # type: ignore - module = importlib.util.module_from_spec(spec) # type: ignore - spec.loader.exec_module(module) # type: ignore - # These type-ignores will need to be looked at. MyPy is wrong. + module = importlib.machinery.SourceFileLoader( + filename, + loadfile + ).load_module() if getattr(module, 'plugin_start3', None): newname = module.plugin_start3(os.path.dirname(loadfile)) self.name = newname and str(newname) or name