mirror of https://github.com/m-labs/artiq.git
worker: keep sys.modules untouched until the end of examine()
This commit is contained in:
parent
8079aa6d20
commit
0b4d06c7a9
|
@ -155,10 +155,6 @@ def examine(device_mgr, dataset_mgr, file):
|
||||||
previous_keys = set(sys.modules.keys())
|
previous_keys = set(sys.modules.keys())
|
||||||
try:
|
try:
|
||||||
module = file_import(file)
|
module = file_import(file)
|
||||||
finally:
|
|
||||||
new_keys = set(sys.modules.keys())
|
|
||||||
for key in new_keys - previous_keys:
|
|
||||||
del sys.modules[key]
|
|
||||||
for class_name, exp_class in module.__dict__.items():
|
for class_name, exp_class in module.__dict__.items():
|
||||||
if class_name[0] == "_":
|
if class_name[0] == "_":
|
||||||
continue
|
continue
|
||||||
|
@ -175,6 +171,10 @@ def examine(device_mgr, dataset_mgr, file):
|
||||||
(k, (proc.describe(), group, tooltip))
|
(k, (proc.describe(), group, tooltip))
|
||||||
for k, (proc, group, tooltip) in argument_mgr.requested_args.items())
|
for k, (proc, group, tooltip) in argument_mgr.requested_args.items())
|
||||||
register_experiment(class_name, name, arginfo)
|
register_experiment(class_name, name, arginfo)
|
||||||
|
finally:
|
||||||
|
new_keys = set(sys.modules.keys())
|
||||||
|
for key in new_keys - previous_keys:
|
||||||
|
del sys.modules[key]
|
||||||
|
|
||||||
|
|
||||||
def setup_diagnostics(experiment_file, repository_path):
|
def setup_diagnostics(experiment_file, repository_path):
|
||||||
|
|
Loading…
Reference in New Issue