From 3ed21a3b60960917dd25c7dec76e555abf10c478 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Fri, 22 Mar 2024 17:30:56 +0800 Subject: [PATCH] fix interactive args cancellation --- artiq/language/environment.py | 5 +++-- artiq/master/databases.py | 2 +- artiq/master/worker_impl.py | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/artiq/language/environment.py b/artiq/language/environment.py index 8b4076a4c..64245e9fa 100644 --- a/artiq/language/environment.py +++ b/artiq/language/environment.py @@ -350,8 +350,9 @@ class HasEnvironment: yield namespace del namespace.setattr_argument argdict = self.__argument_mgr.get_interactive(interactive_arglist, title) - for key, value in argdict.items(): - setattr(namespace, key, value) + if argdict is not None: + for key, value in argdict.items(): + setattr(namespace, key, value) def get_device_db(self): """Returns the full contents of the device database.""" diff --git a/artiq/master/databases.py b/artiq/master/databases.py index 7a4a6b153..6edcc966d 100644 --- a/artiq/master/databases.py +++ b/artiq/master/databases.py @@ -144,4 +144,4 @@ class InteractiveArgDB: if rid not in self.futures: raise ValueError("no experiment with this RID is " "waiting for interactive arguments") - self.futures[rid].cancel() + self.futures[rid].set_result(None) diff --git a/artiq/master/worker_impl.py b/artiq/master/worker_impl.py index 65c7f2a88..1f069a50c 100644 --- a/artiq/master/worker_impl.py +++ b/artiq/master/worker_impl.py @@ -222,8 +222,9 @@ class ArgumentManager(ProcessArgumentManager): arglist_desc = [(k, p.describe(), g, t) for k, p, g, t in interactive_arglist] arguments = ArgumentManager._get_interactive(arglist_desc, title) - for key, processor, _, _ in interactive_arglist: - arguments[key] = processor.process(arguments[key]) + if arguments is not None: + for key, processor, _, _ in interactive_arglist: + arguments[key] = processor.process(arguments[key]) return arguments