serialposix: ignore error when setting control lines in open
- workaround for #59, when opening pseudo tty that have no control lines
diff --git a/serial/serialposix.py b/serial/serialposix.py
index 67a3fd4..72ea9b0 100644
--- a/serial/serialposix.py
+++ b/serial/serialposix.py
@@ -258,10 +258,16 @@
raise
else:
self.is_open = True
- if not self._dsrdtr:
- self._update_dtr_state()
- if not self._rtscts:
- self._update_rts_state()
+ try:
+ if not self._dsrdtr:
+ self._update_dtr_state()
+ if not self._rtscts:
+ self._update_rts_state()
+ except IOError as e:
+ if e.errno == 22: # ignore Invalid argument
+ pass
+ else:
+ raise
self.reset_input_buffer()
def _reconfigure_port(self, force_update=False):