diff options
author | Chris Liechti <cliechti@gmx.net> | 2016-05-23 22:18:43 +0200 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2016-05-23 22:18:43 +0200 |
commit | a83408ad5009976495ebecefa0be3193d2f84fa3 (patch) | |
tree | 99a936d56b791b8ec0058811c7d8e5fe1ba4a60c | |
parent | b658eacb68e790159c9fdb15fef4e5880f1f79f7 (diff) | |
download | pyserial-git-a83408ad5009976495ebecefa0be3193d2f84fa3.tar.gz |
allow baudrate of value 0 (used as hang up signal by some drivers)
-rw-r--r-- | serial/serialutil.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/serial/serialutil.py b/serial/serialutil.py index 7748431..474b4c2 100644 --- a/serial/serialutil.py +++ b/serial/serialutil.py @@ -18,7 +18,7 @@ import time try: memoryview except (NameError, AttributeError): - # implementation does not matter as we do not realy use it. + # implementation does not matter as we do not really use it. # it just must not inherit from something else we might care for. class memoryview(object): # pylint: disable=redefined-builtin,invalid-name pass @@ -230,7 +230,7 @@ class SerialBase(io.RawIOBase): except TypeError: raise ValueError("Not a valid baudrate: {!r}".format(baudrate)) else: - if b <= 0: + if b < 0: raise ValueError("Not a valid baudrate: {!r}".format(baudrate)) self._baudrate = b if self.is_open: |