1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

#1462 Remove Deprecated load_module()

This commit is contained in:
David Sangrey 2023-08-03 16:30:50 -04:00
parent 7c77175f2b
commit 816d041992
No known key found for this signature in database
GPG Key ID: 3AEADBB0186884BC

View File

@ -58,10 +58,9 @@ class Plugin(object):
try:
filename = 'plugin_'
filename += name.encode(encoding='ascii', errors='replace').decode('utf-8').replace('.', '_')
module = importlib.machinery.SourceFileLoader(
filename,
loadfile
).load_module()
spec = importlib.util.spec_from_file_location(filename, loadfile)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
if getattr(module, 'plugin_start3', None):
newname = module.plugin_start3(os.path.dirname(loadfile))