Skip to content
Snippets Groups Projects
Commit d0f6a26f authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Simplify imports

parent fe7cdb53
No related branches found
No related tags found
No related merge requests found
import sys import sys
import importlib from importlib.abc import MetaPathFinder
from importlib.util import spec_from_file_location
from pathlib import Path from pathlib import Path
class GUIFinder(importlib.abc.MetaPathFinder): class GUIFinder(MetaPathFinder):
def __init__(self, name, fallback=None): def __init__(self, name, fallback=None):
self._path = Path(__file__).parent.parent / name self._path = Path(__file__).parent.parent / name
...@@ -22,7 +23,7 @@ def find_spec(self, fullname, _path, _target=None): ...@@ -22,7 +23,7 @@ def find_spec(self, fullname, _path, _target=None):
if module_path is None: if module_path is None:
return None return None
spec = importlib.util.spec_from_file_location(fullname, module_path) spec = spec_from_file_location(fullname, module_path)
return spec return spec
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment