forked from M-Labs/artiq
1
0
Fork 0

Revert "tools/file_import: use python 3.4 importlib API"

This reverts commit 614a96a3d7.

Conflicts:
	artiq/tools.py
This commit is contained in:
Sebastien Bourdeauducq 2015-02-18 08:51:44 -07:00
parent e6d0fc2021
commit 3543dc30c7
1 changed files with 1 additions and 3 deletions

View File

@ -1,5 +1,4 @@
from operator import itemgetter from operator import itemgetter
import sys
import importlib.machinery import importlib.machinery
import linecache import linecache
import logging import logging
@ -32,8 +31,7 @@ def file_import(filename):
sys.path.insert(0, path) sys.path.insert(0, path)
loader = importlib.machinery.SourceFileLoader(modname, filename) loader = importlib.machinery.SourceFileLoader(modname, filename)
module = type(sys)(modname) module = loader.load_module()
loader.exec_module(module)
sys.path.remove(path) sys.path.remove(path)