Skip to content
Snippets Groups Projects
Commit ccd92ee6 authored by Jameson Rollins's avatar Jameson Rollins
Browse files

Merge branch 'master' into 'master'

fix relative imports

See merge request !89
parents 1352253c 82e398a7
No related branches found
No related tags found
1 merge request!89fix relative imports
Pipeline #127751 passed
from __future__ import division from __future__ import division
import os import os
import sys
import logging import logging
import importlib import importlib
import numpy as np import numpy as np
...@@ -22,6 +23,7 @@ def _load_module(name_or_path): ...@@ -22,6 +23,7 @@ def _load_module(name_or_path):
path = os.path.join(path, '__init__.py') path = os.path.join(path, '__init__.py')
spec = importlib.util.spec_from_file_location(modname, path) spec = importlib.util.spec_from_file_location(modname, path)
mod = importlib.util.module_from_spec(spec) mod = importlib.util.module_from_spec(spec)
sys.modules[mod.__name__] = mod
spec.loader.exec_module(mod) spec.loader.exec_module(mod)
else: else:
mod = importlib.import_module(name_or_path) mod = importlib.import_module(name_or_path)
......
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