From 059836c591b3054d2f50b3d3bd6b10455a6411e8 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 4 Apr 2016 19:09:03 +0800 Subject: [PATCH] protocols/remote_exec: give access to controller_initial_namespace --- artiq/protocols/remote_exec.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artiq/protocols/remote_exec.py b/artiq/protocols/remote_exec.py index 45928040c..7d82dc373 100644 --- a/artiq/protocols/remote_exec.py +++ b/artiq/protocols/remote_exec.py @@ -10,6 +10,8 @@ __all__ = ["RemoteExecServer", "RemoteExecClient", "simple_rexec_server_loop"] class RemoteExecServer: def __init__(self, initial_namespace): self.namespace = dict(initial_namespace) + # The module actually has to exist, otherwise it breaks e.g. Numba + self.namespace["__name__"] = "artiq.protocols.remote_exec" def add_code(self, code): exec(code, self.namespace) @@ -21,6 +23,7 @@ class RemoteExecServer: def simple_rexec_server_loop(target_name, target, host, port, description=None): initial_namespace = {"controller_driver": target} + initial_namespace["controller_initial_namespace"] = initial_namespace targets = { target_name: target, target_name + "_rexec": lambda: RemoteExecServer(initial_namespace)