summaryrefslogtreecommitdiff
path: root/pyserial/serial/serialcli.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyserial/serial/serialcli.py')
-rw-r--r--pyserial/serial/serialcli.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pyserial/serial/serialcli.py b/pyserial/serial/serialcli.py
index 5cb76aa..d8eaf1e 100644
--- a/pyserial/serial/serialcli.py
+++ b/pyserial/serial/serialcli.py
@@ -167,8 +167,8 @@ class IronSerial(SerialBase):
def write(self, data):
"""Output the given string over the serial port."""
if not self._port_handle: 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)))
try:
# must call overloaded method with byte array argument
# as this is the only one not applying encodings