summaryrefslogtreecommitdiff
path: root/serial
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2013-10-10 23:57:00 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2013-10-10 23:57:00 +0000
commit2fed04f8f0e345696e07361c0d53ee566ff59b7a (patch)
tree99731b15aeb438c2ccc30e20d99b8f640ac7d351 /serial
parent68d7cd46a21e951a2851dc6bcf3ce47c8163b043 (diff)
downloadpyserial-2fed04f8f0e345696e07361c0d53ee566ff59b7a.tar.gz
[Bug pyserial:141] open: Pass errno from IOError to SerialException
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@463 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'serial')
-rw-r--r--serial/serialposix.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/serial/serialposix.py b/serial/serialposix.py
index 1b7fe86..27c1328 100644
--- a/serial/serialposix.py
+++ b/serial/serialposix.py
@@ -288,9 +288,9 @@ class PosixSerial(SerialBase):
# open
try:
self.fd = os.open(self.portstr, os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK)
- except Exception, msg:
+ except IOError, msg:
self.fd = None
- raise SerialException("could not open port %s: %s" % (self._port, msg))
+ raise SerialException(msg.errno, "could not open port %s: %s" % (self._port, msg))
#~ fcntl.fcntl(self.fd, FCNTL.F_SETFL, 0) # set blocking
try: