diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2009-07-29 21:59:03 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2009-07-29 21:59:03 +0000 |
commit | a3a811fb57c412172745ce86aac94cefe9ce6af6 (patch) | |
tree | 36000d80e918b3e195bd234f981894fd671f684c | |
parent | daf47bad845f742067fe8558aecbaf6d74534e84 (diff) | |
download | pyserial-git-a3a811fb57c412172745ce86aac94cefe9ce6af6.tar.gz |
fix compatibility check
-rw-r--r-- | pyserial/serial/serialutil.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pyserial/serial/serialutil.py b/pyserial/serial/serialutil.py index 38e3d89..ee115e6 100644 --- a/pyserial/serial/serialutil.py +++ b/pyserial/serial/serialutil.py @@ -9,7 +9,7 @@ try: bytes bytearray -except AttributeError: +except (NameError, AttributeError): # Python older than 2.6 do not have these types. Like for Python 2.6 they # should behave like str. For Python older than 3.0 we want to work with # strings anyway, only later versions have a true bytes type. @@ -31,6 +31,7 @@ else: XON = bytes([17]) XOFF = bytes([19]) + PARITY_NONE, PARITY_EVEN, PARITY_ODD, PARITY_MARK, PARITY_SPACE = 'N', 'E', 'O', 'M', 'S' STOPBITS_ONE, STOPBITS_ONE_POINT_FIVE, STOPBITS_TWO = (1, 1.5, 2) FIVEBITS, SIXBITS, SEVENBITS, EIGHTBITS = (5, 6, 7, 8) |