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:
parent
7c77175f2b
commit
816d041992
7
plug.py
7
plug.py
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user