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

#1462 It was, in fact, not that simple.

This commit is contained in:
David Sangrey 2023-08-03 22:31:36 -04:00
parent 59e47bbb17
commit eedb9b840c
No known key found for this signature in database
GPG Key ID: 3AEADBB0186884BC

View File

@ -58,10 +58,10 @@ class Plugin(object):
try: try:
filename = 'plugin_' filename = 'plugin_'
filename += name.encode(encoding='ascii', errors='replace').decode('utf-8').replace('.', '_') filename += name.encode(encoding='ascii', errors='replace').decode('utf-8').replace('.', '_')
spec = importlib.util.spec_from_file_location(filename, loadfile) # type: ignore module = importlib.machinery.SourceFileLoader(
module = importlib.util.module_from_spec(spec) # type: ignore filename,
spec.loader.exec_module(module) # type: ignore loadfile
# These type-ignores will need to be looked at. MyPy is wrong. ).load_module()
if getattr(module, 'plugin_start3', None): if getattr(module, 'plugin_start3', None):
newname = module.plugin_start3(os.path.dirname(loadfile)) newname = module.plugin_start3(os.path.dirname(loadfile))
self.name = newname and str(newname) or name self.name = newname and str(newname) or name