summaryrefslogtreecommitdiff
path: root/serial/serialposix.py
diff options
context:
space:
mode:
Diffstat (limited to 'serial/serialposix.py')
-rw-r--r--serial/serialposix.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/serial/serialposix.py b/serial/serialposix.py
index fa5c999..ce1ff21 100644
--- a/serial/serialposix.py
+++ b/serial/serialposix.py
@@ -488,8 +488,8 @@ class PosixSerial(SerialBase):
def write(self, data):
"""Output the given string over the serial port."""
if not self._isOpen: raise portNotOpenError
- tx_len = len(data)
- d = data
+ d = to_bytes(data)
+ tx_len = len(d)
if self._writeTimeout is not None and self._writeTimeout > 0:
timeout = time.time() + self._writeTimeout
else: