serialhdl: Improve Python3 compatibility

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-12-01 12:40:13 -05:00
parent a4f7ad9ffc
commit 1f4c52e7db
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ class SerialReader:
self.ser.rts = self.rts self.ser.rts = self.rts
self.ser.open() self.ser.open()
else: else:
self.ser = open(self.serialport, 'rb+') self.ser = open(self.serialport, 'rb+', buffering=0)
except (OSError, IOError, serial.SerialException) as e: except (OSError, IOError, serial.SerialException) as e:
logging.warn("Unable to open port: %s", e) logging.warn("Unable to open port: %s", e)
self.reactor.pause(connect_time + 5.) self.reactor.pause(connect_time + 5.)