Skip to content

Commit b9ffead

Browse files
committed
Fixes for Python3
1 parent 71f5945 commit b9ffead

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

magicbus/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def __init__(self, transitions=None, errors=None,
166166
self.listeners[c] = set()
167167

168168
if id is None:
169-
id = hex(random.randint(0, sys.maxint))[-8:]
169+
id = hex(random.randint(0, sys.maxsize))[-8:]
170170
self.id = id
171171
self._priorities = {}
172172
self._state_transition_pipes = set()
@@ -202,7 +202,7 @@ def _transition(self, newstate, *args, **kwargs):
202202
# Write to any pipes created by threads calling self.wait().
203203
# Use list() to avoid "Set changed size during iteration" errors.
204204
for read_fd, write_fd in list(self._state_transition_pipes):
205-
os.write(write_fd, "1")
205+
os.write(write_fd, b"1")
206206

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

0 commit comments

Comments
 (0)