diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2013-10-16 02:57:27 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2013-10-16 02:57:27 +0000 |
commit | f911f1be9b07d0489f4e51c8d39e277c552ed9ae (patch) | |
tree | 8fe7d9de8d4bb052d04d75db64c05aa59cf9f2a3 /serial/urlhandler/protocol_loop.py | |
parent | 6a5185b55c57f56abe67cead08925ac78fb1830b (diff) | |
download | pyserial-f911f1be9b07d0489f4e51c8d39e277c552ed9ae.tar.gz |
Ensure working with bytes in write() calls. to_bytes() extended to handle bytes and memoryview instaces
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@479 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'serial/urlhandler/protocol_loop.py')
-rw-r--r-- | serial/urlhandler/protocol_loop.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/serial/urlhandler/protocol_loop.py b/serial/urlhandler/protocol_loop.py index e6b3ebd..7da94ad 100644 --- a/serial/urlhandler/protocol_loop.py +++ b/serial/urlhandler/protocol_loop.py @@ -145,7 +145,7 @@ class LoopbackSerial(SerialBase): closed.""" if not self._isOpen: raise portNotOpenError # ensure we're working with bytes - data = bytes(data) + data = to_bytes(data) # calculate aprox time that would be used to send the data time_used_to_send = 10.0*len(data) / self._baudrate # when a write timeout is configured check if we would be successful |