mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-12 23:37:14 +03:00
#1462 It was, in fact, not that simple.
This commit is contained in:
parent
59e47bbb17
commit
eedb9b840c
8
plug.py
8
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user