diff --git a/artiq/language/environment.py b/artiq/language/environment.py index b7b10052b..779d74fb8 100644 --- a/artiq/language/environment.py +++ b/artiq/language/environment.py @@ -213,8 +213,12 @@ class HasEnvironment: Other initialization steps such as requesting devices may also be performed here. - When the repository is scanned, any requested devices and arguments - are set to ``None``. + There are two situations where the requested devices are replaced by + ``DummyDevice()`` and arguments are set to their defaults (or ``None``) + instead: when the repository is scanned to build the list of + available experiments and when the dataset browser ``artiq_browser`` + is used to open or run the analysis stage of an experiment. Do not + rely on being able to operate on devices or arguments in ``build()``. Datasets are read-only in this method. diff --git a/artiq/master/worker_impl.py b/artiq/master/worker_impl.py index e1c6eb07a..ccdb11159 100644 --- a/artiq/master/worker_impl.py +++ b/artiq/master/worker_impl.py @@ -11,7 +11,7 @@ import artiq from artiq.protocols import pipe_ipc, pyon from artiq.protocols.packed_exceptions import raise_packed_exc from artiq.tools import multiline_log_config, file_import -from artiq.master.worker_db import DeviceManager, DatasetManager +from artiq.master.worker_db import DeviceManager, DatasetManager, DummyDevice from artiq.language.environment import (is_experiment, TraceArgumentManager, ProcessArgumentManager) from artiq.language.core import set_watchdog_factory, TerminationRequested @@ -124,7 +124,7 @@ class ExamineDeviceMgr: get_device_db = make_parent_action("get_device_db") def get(name): - return None + return DummyDevice() def examine(device_mgr, dataset_mgr, file):