Skip to content

Commit 261b5d7

Browse files
committed
fix: fix syntax error in scxml actions and update diagram doctest
- Parenthesize multiple exception types in except clause (Python 3 syntax) - Update diagram doctest to match new compound graph output
1 parent c817b3e commit 261b5d7

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

statemachine/contrib/diagram.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,10 @@ def quickchart_write_svg(sm: StateChart, path: str):
235235
>>> sm = OrderControl()
236236
>>> print(sm._graph().to_string())
237237
digraph OrderControl {
238-
label=OrderControl;
238+
compound=true;
239239
fontname=Arial;
240240
fontsize="10pt";
241+
label=OrderControl;
241242
rankdir=LR;
242243
...
243244

statemachine/io/scxml/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def create_send_action_callable(action: SendAction) -> Callable:
362362
if action.content:
363363
try:
364364
content = (eval(action.content, {}, {}),)
365-
except NameError, IndentationError, SyntaxError, TypeError:
365+
except (NameError, IndentationError, SyntaxError, TypeError):
366366
content = (action.content,)
367367

368368
def send_action(*args, **kwargs):

0 commit comments

Comments
 (0)