diff --git a/labscript_devices/FunctionRunner/utils.py b/labscript_devices/FunctionRunner/utils.py index 7783e86e..c920aeb3 100644 --- a/labscript_devices/FunctionRunner/utils.py +++ b/labscript_devices/FunctionRunner/utils.py @@ -52,6 +52,8 @@ def deserialise_function( """Deserialise a function that was serialised by serialise_function. Optional __name__ and __file__ arguments set those attributes in the namespace that the function will be defined.""" + if isinstance(name, bytes): + name = name.decode('utf8') args = deserialise(args) kwargs = deserialise(kwargs) code = compile(source, '', 'exec', dont_inherit=True,)