summaryrefslogtreecommitdiff
path: root/serial
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2014-08-04 10:35:10 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2014-08-04 10:35:10 +0000
commitd8a932117e742e459066c10e67cad27a73cdc5f2 (patch)
tree1dc8bb4f617c31fd0eda902d692a86ad106d9694 /serial
parent58059755f7010fd12507068f815632db05ad0935 (diff)
downloadpyserial-d8a932117e742e459066c10e67cad27a73cdc5f2.tar.gz
[Bug pyserial:156] PosixSerial.open raises OSError rather than SerialException when port open fails
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@507 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'serial')
-rw-r--r--serial/serialposix.py2
1 files changed, 1 insertions, 1 deletions
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