[Python-checkins] python/dist/src/Lib socket.py,1.20,1.21

nnorwitz@users.sourceforge.net nnorwitz@users.sourceforge.net
Thu, 13 Jun 2002 15:18:41 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv25865/Lib

Modified Files:
	socket.py 
Log Message:
Cleanup a little

Index: socket.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** socket.py	6 Jun 2002 21:08:16 -0000	1.20
--- socket.py	13 Jun 2002 22:18:39 -0000	1.21
***************
*** 198,202 ****
              self._wbuf = [ ]
  
!     def fileno (self):
          return self._sock.fileno()
  
--- 198,202 ----
              self._wbuf = [ ]
  
!     def fileno(self):
          return self._sock.fileno()
  
***************
*** 236,246 ****
              buf_len += len(data)
              self._rbuf.append(data)
-         data = ''.join(self._rbuf)
          # Clear the rbuf at the end so we're not affected by
          # an exception during a recv
          self._rbuf = [ ]
          if buf_len > size and size >= 0:
!            self._rbuf.append(data[size:])
!            data = data[:size]
          return data
  
--- 236,246 ----
              buf_len += len(data)
              self._rbuf.append(data)
          # Clear the rbuf at the end so we're not affected by
          # an exception during a recv
+         data = ''.join(self._rbuf)
          self._rbuf = [ ]
          if buf_len > size and size >= 0:
!             self._rbuf.append(data[size:])
!             data = data[:size]
          return data
  
***************
*** 248,252 ****
          index = -1
          buf_len = self.__get_rbuf_len()
!         if len (self._rbuf):
              index = min([x.find('\n') for x in self._rbuf])
          while index < 0 and (size < 0 or buf_len < size):
--- 248,252 ----
          index = -1
          buf_len = self.__get_rbuf_len()
!         if self._rbuf:
              index = min([x.find('\n') for x in self._rbuf])
          while index < 0 and (size < 0 or buf_len < size):
***************
*** 276,280 ****
          while 1:
              line = self.readline()
!             if not line: break
              list.append(line)
              total += len(line)
--- 276,281 ----
          while 1:
              line = self.readline()
!             if not line:
!                 break
              list.append(line)
              total += len(line)