Skip to content

Commit d2342ae

Browse files
Allow FunctionRunner to use indented function definitions
1 parent 5b22fde commit d2342ae

File tree

1 file changed

+2
-1
lines changed
  • labscript_devices/FunctionRunner

1 file changed

+2
-1
lines changed

labscript_devices/FunctionRunner/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#####################################################################
1313

1414
import inspect
15+
import textwrap
1516
from types import FunctionType
1617
from labscript_utils import dedent
1718
from labscript_utils.properties import serialise, deserialise
@@ -38,7 +39,7 @@ def serialise_function(function, *args, **kwargs):
3839
raise TypeError(dedent(msg))
3940

4041
# Serialise the function, args and kwargs:
41-
source = inspect.getsource(function)
42+
source = textwrap.dedent(inspect.getsource(function))
4243
args = serialise(args)
4344
kwargs = serialise(kwargs)
4445

0 commit comments

Comments
 (0)