Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions magicbus/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __init__(self, transitions=None, errors=None,
self.listeners[c] = set()

if id is None:
id = hex(random.randint(0, sys.maxint))[-8:]
id = hex(random.randint(0, sys.maxsize))[-8:]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: looks like it's "work for uuid module". But not in this PR, of course :)

This comment was marked as resolved.

self.id = id
self._priorities = {}
self._state_transition_pipes = set()
Expand Down Expand Up @@ -202,7 +202,7 @@ def _transition(self, newstate, *args, **kwargs):
# Write to any pipes created by threads calling self.wait().
# Use list() to avoid "Set changed size during iteration" errors.
for read_fd, write_fd in list(self._state_transition_pipes):
os.write(write_fd, "1")
os.write(write_fd, b"1")

# Note: logging here means 1) the initial transition
# will not be logged if loggers are set up in the initial
Expand Down