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 | 60e2a3d16dbf67bb2ba74fe94a944af9da3716b8 (patch) | |
tree | 5bed8fbda013e79346cab34ca579802e31d1b725 | |
parent | 9a3e44d8f5ec5c946f697cb85c50fddbbc13fc9a (diff) | |
download | pyserial-60e2a3d16dbf67bb2ba74fe94a944af9da3716b8.tar.gz |
rename internal variable
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@465 f19166aa-fa4f-0410-85c2-fa1106f25c8a
-rw-r--r-- | serial/serialposix.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/serial/serialposix.py b/serial/serialposix.py index 27c1328..65e865b 100644 --- a/serial/serialposix.py +++ b/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,)) |