aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-10-31 14:15:32 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-10-31 14:15:32 -0400
commitd23c1b06c6e1429e34ad73139bcaef5cb3f66aeb (patch)
treef41d97faa305a41a589fa74f666f7d46e5bb1b22 /klippy
parentdd98884bb43afdb64a21fc9e98f94f74572ab088 (diff)
downloadkutter-d23c1b06c6e1429e34ad73139bcaef5cb3f66aeb.tar.gz
kutter-d23c1b06c6e1429e34ad73139bcaef5cb3f66aeb.tar.xz
kutter-d23c1b06c6e1429e34ad73139bcaef5cb3f66aeb.zip
gcode: Fix Python3 syntax error
Fix error introduced in d6c3aaad. Also, go back to only accepting ascii characters on input. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/gcode.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py
index e1769e47..66fc623c 100644
--- a/klippy/gcode.py
+++ b/klippy/gcode.py
@@ -381,8 +381,8 @@ class GCodeIO:
def _process_data(self, eventtime):
# Read input, separate by newline, and add to pending_commands
try:
- data = str(os.read(self.fd, 4096).decode('utf8'))
- except os.error, UnicodeDecodeError:
+ data = str(os.read(self.fd, 4096).decode())
+ except (os.error, UnicodeDecodeError):
logging.exception("Read g-code")
return
self.input_log.append((eventtime, data))