Skip to content

Commit 9dc2162

Browse files
Fix bug in FunctionRunner function deserialisation
In h5py 3.0, all strings from datasets are returned as bytestrings: h5py/h5py#1338 Luckily this isn't more of an issue throughout the labscript suite, because we still have lots of code that is unassuming about string datatypes due to the port from Python 2. But it will probably show up elsewhere too.
1 parent 75b175d commit 9dc2162

File tree

1 file changed

+2
-0
lines changed
  • labscript_devices/FunctionRunner

1 file changed

+2
-0
lines changed

labscript_devices/FunctionRunner/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def deserialise_function(
5252
"""Deserialise a function that was serialised by serialise_function. Optional
5353
__name__ and __file__ arguments set those attributes in the namespace that the
5454
function will be defined."""
55+
if isinstance(name, bytes):
56+
name = name.decode('utf8')
5557
args = deserialise(args)
5658
kwargs = deserialise(kwargs)
5759
code = compile(source, '<string>', 'exec', dont_inherit=True,)

0 commit comments

Comments
 (0)