Skip to content

Commit

Permalink
_build_event: Ensure __name__ is a str
Browse files Browse the repository at this point in the history
Python 3 is happy to receive `__name__` objects as Unicode or plain
strings, but Python 2 is not.  This bug shows itself when
`unicode_literals` is imported from calling code.

mriehl#31
  • Loading branch information
Stuart Longland committed Mar 14, 2017
1 parent a1c8938 commit 983e5fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/python/fysom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def _tran():
self._reenter_state(e)
self._after_event(e)

fn.__name__ = event
fn.__name__ = str(event)
fn.__doc__ = ("Event handler for an {event} event. This event can be " +
"fired if the machine is in {states} states.".format(
event=event, states=self._map[event].keys()))
Expand Down

0 comments on commit 983e5fa

Please sign in to comment.