diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2013-10-11 01:13:46 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2013-10-11 01:13:46 +0000 |
commit | 9f7c235791523827abe65bcaf6ce6fbbca625b03 (patch) | |
tree | 1031d8b72947ab8703865f25c001d4f83a424e94 | |
parent | 1ae5ab0657e6d99eeb264d96581388072266a3fb (diff) | |
download | pyserial-git-9f7c235791523827abe65bcaf6ce6fbbca625b03.tar.gz |
rename internal variable
-rw-r--r-- | pyserial/serial/serialposix.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pyserial/serial/serialposix.py b/pyserial/serial/serialposix.py index 27c1328..65e865b 100644 --- a/pyserial/serial/serialposix.py +++ b/pyserial/serial/serialposix.py @@ -479,13 +479,13 @@ class PosixSerial(SerialBase): def write(self, data): """Output the given string over the serial port.""" if not self._isOpen: raise portNotOpenError - t = len(data) + tx_len = len(data) d = data if self._writeTimeout is not None and self._writeTimeout > 0: timeout = time.time() + self._writeTimeout else: timeout = None - while t > 0: + while tx_len > 0: try: n = os.write(self.fd, d) if timeout: @@ -498,7 +498,7 @@ class PosixSerial(SerialBase): if not ready: raise writeTimeoutError d = d[n:] - t = t - n + tx_len -= n except OSError, v: if v.errno != errno.EAGAIN: raise SerialException('write failed: %s' % (v,)) |