From 60e2a3d16dbf67bb2ba74fe94a944af9da3716b8 Mon Sep 17 00:00:00 2001 From: cliechti Date: Fri, 11 Oct 2013 01:13:46 +0000 Subject: rename internal variable git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@465 f19166aa-fa4f-0410-85c2-fa1106f25c8a --- serial/serialposix.py | 6 +++--- 1 file 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,)) -- cgit v1.2.1