summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt2
-rw-r--r--serial/serialposix.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 663dbeb..f9cf277 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -494,6 +494,8 @@ Bugfixes:
Bugfixes (posix):
+- [Bug pyserial:156] PosixSerial.open raises OSError rather than
+ SerialException when port open fails
- [Bug pyserial:163] serial.tools.list_ports.grep() fails if it encounters None type
Bugfixes (cli):
diff --git a/serial/serialposix.py b/serial/serialposix.py
index 43004b3..78ffb39 100644
--- a/serial/serialposix.py
+++ b/serial/serialposix.py
@@ -291,7 +291,7 @@ class PosixSerial(SerialBase):
# open
try:
self.fd = os.open(self.portstr, os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK)
- except IOError, msg:
+ except OSError, msg:
self.fd = None
raise SerialException(msg.errno, "could not open port %s: %s" % (self._port, msg))
#~ fcntl.fcntl(self.fd, FCNTL.F_SETFL, 0) # set blocking