summaryrefslogtreecommitdiff
path: root/pyserial/serial/serialposix.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyserial/serial/serialposix.py')
-rw-r--r--pyserial/serial/serialposix.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pyserial/serial/serialposix.py b/pyserial/serial/serialposix.py
index c3cc284..bbf7fb9 100644
--- a/pyserial/serial/serialposix.py
+++ b/pyserial/serial/serialposix.py
@@ -462,8 +462,8 @@ class PosixSerial(SerialBase):
def write(self, data):
"""Output the given string over the serial port."""
if self.fd is None: raise portNotOpenError
- if not isinstance(data, bytes):
- raise TypeError('expected %s, got %s' % (bytes, type(data)))
+ if not isinstance(data, (bytes, bytearray)):
+ raise TypeError('expected %s or bytearray, got %s' % (bytes, type(data)))
t = len(data)
d = data
while t > 0: