From cf56a24d294d71abf53dac00773b8eb5d129d95a Mon Sep 17 00:00:00 2001 From: Thomas Fish Date: Tue, 15 Jun 2021 15:42:55 +0100 Subject: [PATCH] stop "conf"s all being the same dict --- microscope/device_server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/microscope/device_server.py b/microscope/device_server.py index 9067365d..01bd2f22 100644 --- a/microscope/device_server.py +++ b/microscope/device_server.py @@ -81,7 +81,7 @@ def device( cls: typing.Callable, host: str, port: int, - conf: typing.Mapping[str, typing.Any] = {}, + conf: typing.Mapping[str, typing.Any] = None, uid: typing.Optional[str] = None, ): """Define devices and where to serve them. @@ -119,6 +119,8 @@ def construct_devices() -> typing.Dict[str, Device]: ] """ + if conf is None: + conf = {} if not callable(cls): raise TypeError("cls must be a callable") elif isinstance(cls, type):