Skip to content

Commit 0bfeec3

Browse files
termimaleneum
authored andcommitted
Fix diagrams_pygraphviz.Graph.get_graph method when states are enums
1 parent a15aa97 commit 0bfeec3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

transitions/extensions/diagrams_pygraphviz.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ def get_graph(self, title=None):
7474
if self.roi_state:
7575
filtered = self.fsm_graph.copy()
7676
kept_nodes = set()
77-
active_state = self.roi_state if filtered.has_node(self.roi_state) else self.roi_state + '_anchor'
77+
active_state = self.roi_state.name if hasattr(self.roi_state, 'name') else self.roi_state
78+
if not filtered.has_node(self.roi_state):
79+
active_state += '_anchor'
7880
kept_nodes.add(active_state)
7981

8082
# remove all edges that have no connection to the currently active state

0 commit comments

Comments
 (0)