posix: deprecate "nonblocking" method
diff --git a/serial/serialposix.py b/serial/serialposix.py
index 28164d8..bc2468c 100644
--- a/serial/serialposix.py
+++ b/serial/serialposix.py
@@ -635,12 +635,6 @@
s = fcntl.ioctl(self.fd, TIOCOUTQ, TIOCM_zero_str)
return struct.unpack('I', s)[0]
- def nonblocking(self):
- """internal - not portable!"""
- if not self.is_open:
- raise portNotOpenError
- fcntl.fcntl(self.fd, fcntl.F_SETFL, os.O_NONBLOCK)
-
def fileno(self):
"""\
For easier use of the serial port instance with select.
@@ -676,6 +670,11 @@
else:
termios.tcflow(self.fd, termios.TCOOFF)
+ def nonblocking(self):
+ """DEPRECATED - has no use"""
+ import warnings
+ warnings.warn("nonblocking() has no effect, already nonblocking", DeprecationWarning)
+
class PosixPollSerial(Serial):
"""\