summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2009-07-29 21:59:03 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2009-07-29 21:59:03 +0000
commitcdc75aed09a15c9eaf175896132dbb95e9e75ba1 (patch)
treec7950496fb06aaf60e6e77d484d10d3665b7416d
parente6f8347a906d77b9f360b3fc1f8489d01d7acc82 (diff)
downloadpyserial-cdc75aed09a15c9eaf175896132dbb95e9e75ba1.tar.gz
fix compatibility check
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@257 f19166aa-fa4f-0410-85c2-fa1106f25c8a
-rw-r--r--serial/serialutil.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/serial/serialutil.py b/serial/serialutil.py
index 38e3d89..ee115e6 100644
--- a/serial/serialutil.py
+++ b/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)