forked from M-Labs/artiq
Revert "tools/file_import: use python 3.4 importlib API"
This reverts commit 614a96a3d7
.
Conflicts:
artiq/tools.py
This commit is contained in:
parent
e6d0fc2021
commit
3543dc30c7
|
@ -1,5 +1,4 @@
|
|||
from operator import itemgetter
|
||||
import sys
|
||||
import importlib.machinery
|
||||
import linecache
|
||||
import logging
|
||||
|
@ -32,8 +31,7 @@ def file_import(filename):
|
|||
sys.path.insert(0, path)
|
||||
|
||||
loader = importlib.machinery.SourceFileLoader(modname, filename)
|
||||
module = type(sys)(modname)
|
||||
loader.exec_module(module)
|
||||
module = loader.load_module()
|
||||
|
||||
sys.path.remove(path)
|
||||
|
||||
|
|
Loading…
Reference in New Issue