From: Ben Darnell Date: Thu, 13 Jan 2011 18:51:35 +0000 (-0800) Subject: Replace more uses of cStringIO.getvalue() with .tell(). X-Git-Tag: v1.2.0~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7dd49cd60e81834ff6a091fef3ce4bb0e3e6d5d;p=thirdparty%2Ftornado.git Replace more uses of cStringIO.getvalue() with .tell(). --- diff --git a/tornado/iostream.py b/tornado/iostream.py index 74c9325c7..b361204e5 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -209,7 +209,7 @@ class IOStream(object): state = self.io_loop.ERROR if self._read_delimiter or self._read_bytes: state |= self.io_loop.READ - if self._write_buffer.getvalue(): + if self._write_buffer.tell(): state |= self.io_loop.WRITE if state != self._state: self._state = state @@ -331,7 +331,7 @@ class IOStream(object): self._connecting = False def _handle_write(self): - while self._write_buffer.getvalue(): + while self._write_buffer.tell(): try: # On windows, socket.send blows up if given a write buffer # that's too large, instead of just returning the number @@ -348,7 +348,7 @@ class IOStream(object): self.socket.fileno(), e) self.close() return - if not self._write_buffer.getvalue() and self._write_callback: + if not self._write_buffer.tell() and self._write_callback: callback = self._write_callback self._write_callback = None self._run_callback(callback)