[Python-checkins] python/dist/src/Lib asyncore.py,1.42,1.43

akuchling at users.sourceforge.net akuchling at users.sourceforge.net
Wed Oct 22 10:38:29 EDT 2003


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

Modified Files:
	asyncore.py 
Log Message:
[Part of patch #648322] Delete the poll2() function, which uses a 'poll' extension module that was once part of Medusa.  Contributed by Kjetil Jacobsen

Index: asyncore.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** asyncore.py	22 Oct 2003 13:48:27 -0000	1.42
--- asyncore.py	22 Oct 2003 14:38:27 -0000	1.43
***************
*** 126,153 ****
  
  def poll2(timeout=0.0, map=None):
-     import poll
-     if map is None:
-         map = socket_map
-     if timeout is not None:
-         # timeout is in milliseconds
-         timeout = int(timeout*1000)
-     if map:
-         l = []
-         for fd, obj in map.items():
-             flags = 0
-             if obj.readable():
-                 flags = poll.POLLIN
-             if obj.writable():
-                 flags = flags | poll.POLLOUT
-             if flags:
-                 l.append((fd, flags))
-         r = poll.poll(l, timeout)
-         for fd, flags in r:
-             obj = map.get(fd)
-             if obj is None:
-                 continue
-             readwrite(obj, flags)
- 
- def poll3(timeout=0.0, map=None):
      # Use the poll() support added to the select module in Python 2.0
      if map is None:
--- 126,129 ----
***************
*** 178,190 ****
              readwrite(obj, flags)
  
  def loop(timeout=30.0, use_poll=0, map=None):
      if map is None:
          map = socket_map
  
!     if use_poll:
!         if hasattr(select, 'poll'):
!             poll_fun = poll3
!         else:
!             poll_fun = poll2
      else:
          poll_fun = poll
--- 154,165 ----
              readwrite(obj, flags)
  
+ poll3 = poll2                           # Alias for backward compatibility
+ 
  def loop(timeout=30.0, use_poll=0, map=None):
      if map is None:
          map = socket_map
  
!     if use_poll and hasattr(select, 'poll'):
!         poll_fun = poll2
      else:
          poll_fun = poll





More information about the Python-checkins mailing list