improve python 3 compatibility
diff --git a/serial/serialutil.py b/serial/serialutil.py
index 1bd0f0c..0844ecd 100644
--- a/serial/serialutil.py
+++ b/serial/serialutil.py
@@ -33,7 +33,11 @@
else:
b = bytearray()
for item in seq:
- b.append(item) # this one handles int and str for our emulation and ints for Python 3.x
+ # this one handles int and bytes in Python 2.7
+ # add conversion in case of Python 3.x
+ if isinstance(item, bytes):
+ item = ord(item)
+ b.append(item)
return bytes(b)
# create control bytes