Update for Python3
This commit is contained in:
@@ -58,7 +58,7 @@ class Interface:
|
||||
while (self.running):
|
||||
tty_in = os.read(self.m, readLen)
|
||||
for tty_out in self.handleInput(tty_in):
|
||||
os.write(self.m, tty_out)
|
||||
os.write(self.m, tty_out.encode())
|
||||
|
||||
|
||||
##%% handleInput(tty_in)
|
||||
@@ -67,7 +67,7 @@ class Interface:
|
||||
## address. That device must handle the command via dev.handleCMD(cmd, args)
|
||||
##
|
||||
def handleInput(self, tty_in):
|
||||
tty_in = tty_in.strip()
|
||||
tty_in = tty_in.strip().decode()
|
||||
|
||||
if tty_in != "" and self.addr in self.devices:
|
||||
dev = self.devices[self.addr]
|
||||
@@ -83,5 +83,5 @@ class Interface:
|
||||
##
|
||||
def addDevice(self, dev, addr):
|
||||
self.devices[addr] = dev
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user