@@ -12,6 +12,7 @@
import bb
import bb.event
+import collections
import logging
import multiprocessing
import threading
@@ -250,7 +251,9 @@ class ProcessServer():
# Where to write events to
writer = ConnectionWriter(ui_fds[0])
- self.event_handle = bb.event.register_UIHhandler(writer, True)
+ # bb.event expects an 'event' property on whatever you pass as a UI handler
+ ConnectionWriterEventWrapper = collections.namedtuple('ConnectionWriterEventWrapper', ['event'])
+ self.event_handle = bb.event.register_UIHhandler(ConnectionWriterEventWrapper(writer), True)
self.event_writer = writer
# Where to read commands from
@@ -850,8 +853,6 @@ class ConnectionWriter(object):
def __init__(self, fd):
self.writer = multiprocessing.connection.Connection(fd, readable=False)
self.wlock = multiprocessing.Lock()
- # Why bb.event needs this I have no idea
- self.event = self
def _send(self, obj):
gc.disable()