From e102962247dc3efe7078cad10036608f85562809 Mon Sep 17 00:00:00 2001 From: Chris Liechti Date: Sun, 2 Oct 2016 23:54:36 +0200 Subject: serialposix: use names instead of numbers (errno) --- serial/serialposix.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/serial/serialposix.py b/serial/serialposix.py index 78959ce..35eb858 100644 --- a/serial/serialposix.py +++ b/serial/serialposix.py @@ -273,7 +273,8 @@ class Serial(SerialBase, PlatformSpecific): if not self._rtscts: self._update_rts_state() except IOError as e: - if e.errno in (22, 25): # ignore Invalid argument and Inappropriate ioctl + if e.errno in (errno.EINVAL, errno.ENOTTY): + # ignore Invalid argument and Inappropriate ioctl pass else: raise -- cgit v1.2.1