Commits

Ian George committed 7f8240f

Passing wrong state when calling state.enter

Comments (0)

Files changed (1)

statemachine/fsm.py

         """
         Runs an entry action if it is set
         """
+        print exited_state.name, self.name
         if self.entry_action:
             return self.entry_action(exited_state, *args, **kwargs)
 
         #TODO: this needs to be transactional, shouldn't exit unless it
         #can enter
         exiting_state.exit(entering_state, *args, **kwargs)
-        entering_state.enter(entering_state, *args, **kwargs)
+        entering_state.enter(exiting_state, *args, **kwargs)
 
         self.__state = new_state