From 8d8c239e47e783c7e7c47f4857f252844c994bfc Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 11 Jun 2020 21:40:32 -0400 Subject: [PATCH] util: Improve Python3 compatibility Signed-off-by: Kevin O'Connor --- klippy/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/klippy/util.py b/klippy/util.py index 201ff528..14009855 100644 --- a/klippy/util.py +++ b/klippy/util.py @@ -38,7 +38,7 @@ def create_pty(ptyname): except os.error: pass filename = os.ttyname(sfd) - os.chmod(filename, 0660) + os.chmod(filename, 0o660) os.symlink(filename, ptyname) set_nonblock(mfd) old = termios.tcgetattr(mfd) @@ -99,7 +99,7 @@ def get_cpu_info(): f = open('/proc/cpuinfo', 'rb') data = f.read() f.close() - except IOError, OSError: + except (IOError, OSError) as e: logging.debug("Exception on read /proc/cpuinfo: %s", traceback.format_exc()) return "?"