artiq_run: use "artiq_run_" as user code module prefix, not "file_import_".

This commit is contained in:
whitequark 2015-08-28 02:22:59 -05:00
parent edf33f1643
commit 6b8ef8c490
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ def _build_experiment(dmgr, pdb, rdb, args):
"for ELF kernels")
return ELFRunner(dmgr, pdb, rdb, file=args.file)
else:
module = file_import(args.file)
module = file_import(args.file, prefix="artiq_run_")
file = args.file
else:
module = sys.modules["__main__"]

View File

@ -19,7 +19,7 @@ def parse_arguments(arguments):
return d
def file_import(filename):
def file_import(filename, prefix="file_import_"):
linecache.checkcache(filename)
modname = filename
@ -29,7 +29,7 @@ def file_import(filename):
i = modname.find(".")
if i > 0:
modname = modname[:i]
modname = "file_import_" + modname
modname = prefix + modname
path = os.path.dirname(os.path.realpath(filename))
sys.path.insert(0, path)