From 926238a2c54daae80d4c561b4cda8546d40173a7 Mon Sep 17 00:00:00 2001 From: JCTutorius Date: Wed, 21 Oct 2009 05:06:48 +0000 Subject: vault merge --- (limited to 'tutorius/core.py') diff --git a/tutorius/core.py b/tutorius/core.py index 6030457..15a0c87 100644 --- a/tutorius/core.py +++ b/tutorius/core.py @@ -515,9 +515,10 @@ class FiniteStateMachine(State): #TODO : Move this code inside the State itself - we're breaking # encap :P - for event, state in st._transitions: - if state == state_name: - del st._transitions[event] + if st._transitions: + for event, state in st._transitions.items(): + if state == state_name: + del st._transitions[event] # Remove the state from the dictionary del self._states[state_name] -- cgit v0.9.1