[Python-checkins] python/dist/src/Lib asyncore.py,1.45,1.46

akuchling at users.sourceforge.net akuchling at users.sourceforge.net
Sun Mar 21 14:46:22 EST 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8687

Modified Files:
	asyncore.py 
Log Message:
[Part of patch #909005] Use True/False

Index: asyncore.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** asyncore.py	21 Mar 2004 19:26:00 -0000	1.45
--- asyncore.py	21 Mar 2004 19:46:16 -0000	1.46
***************
*** 158,162 ****
  poll3 = poll2                           # Alias for backward compatibility
  
! def loop(timeout=30.0, use_poll=0, map=None):
      if map is None:
          map = socket_map
--- 158,162 ----
  poll3 = poll2                           # Alias for backward compatibility
  
! def loop(timeout=30.0, use_poll=False, map=None):
      if map is None:
          map = socket_map
***************
*** 172,179 ****
  class dispatcher:
  
!     debug = 0
!     connected = 0
!     accepting = 0
!     closing = 0
      addr = None
  
--- 172,179 ----
  class dispatcher:
  
!     debug = False
!     connected = False
!     accepting = False
!     closing = False
      addr = None
  
***************
*** 188,192 ****
              # I think it should inherit this anyway
              self.socket.setblocking(0)
!             self.connected = 1
              # XXX Does the constructor require that the socket passed
              # be connected?
--- 188,192 ----
              # I think it should inherit this anyway
              self.socket.setblocking(0)
!             self.connected = True
              # XXX Does the constructor require that the socket passed
              # be connected?
***************
*** 274,278 ****
  
      def listen(self, num):
!         self.accepting = 1
          if os.name == 'nt' and num > 5:
              num = 1
--- 274,278 ----
  
      def listen(self, num):
!         self.accepting = True
          if os.name == 'nt' and num > 5:
              num = 1
***************
*** 284,288 ****
  
      def connect(self, address):
!         self.connected = 0
          err = self.socket.connect_ex(address)
          # XXX Should interpret Winsock return values
--- 284,288 ----
  
      def connect(self, address):
!         self.connected = False
          err = self.socket.connect_ex(address)
          # XXX Should interpret Winsock return values
***************
*** 291,295 ****
          if err in (0, EISCONN):
              self.addr = address
!             self.connected = 1
              self.handle_connect()
          else:
--- 291,295 ----
          if err in (0, EISCONN):
              self.addr = address
!             self.connected = True
              self.handle_connect()
          else:
***************
*** 361,369 ****
              # that we are connected
              if not self.connected:
!                 self.connected = 1
              self.handle_accept()
          elif not self.connected:
              self.handle_connect()
!             self.connected = 1
              self.handle_read()
          else:
--- 361,369 ----
              # that we are connected
              if not self.connected:
!                 self.connected = True
              self.handle_accept()
          elif not self.connected:
              self.handle_connect()
!             self.connected = True
              self.handle_read()
          else:
***************
*** 374,378 ****
          if not self.connected:
              self.handle_connect()
!             self.connected = 1
          self.handle_write()
  
--- 374,378 ----
          if not self.connected:
              self.handle_connect()
!             self.connected = True
          self.handle_write()
  
***************
*** 519,523 ****
          def __init__(self, fd):
              dispatcher.__init__(self)
!             self.connected = 1
              # set it to non-blocking mode
              flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0)
--- 519,523 ----
          def __init__(self, fd):
              dispatcher.__init__(self)
!             self.connected = True
              # set it to non-blocking mode
              flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0)




More information about the Python-checkins mailing list