forked from M-Labs/artiq
artiq_run: use "artiq_run_" as user code module prefix, not "file_import_".
This commit is contained in:
parent
edf33f1643
commit
6b8ef8c490
@ -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__"]
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user