[Python-checkins] CVS: python/dist/src/Lib/test test_poll.py,1.2,1.3

A.M. Kuchling python-dev@python.org
Tue, 29 Aug 2000 09:53:37 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv20481

Modified Files:
	test_poll.py 
Log Message:
Fix for two problems on FreeBSD:
In test_poll1(), unregister file descriptors as they're closed,
    and also close the read end of the pipe
In test_poll2(), make the code assume less about the combinations of flag
    bits that will be returned


Index: test_poll.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_poll.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_poll.py	2000/08/26 08:24:18	1.2
--- test_poll.py	2000/08/29 16:53:34	1.3
***************
*** 58,62 ****
          assert len(buf) == MSG_LEN
          print buf
!         os.close(r2w[rd])
          writers.remove(r2w[rd])
  
--- 58,64 ----
          assert len(buf) == MSG_LEN
          print buf
!         os.close(r2w[rd]) ; os.close( rd )
!         p.unregister( r2w[rd] )
!         p.unregister( rd )
          writers.remove(r2w[rd])
  
***************
*** 146,150 ****
          if (fdlist == []):
              continue
!         if fdlist[0] == (p.fileno(),select.POLLHUP):
              line = p.readline()
              if line != "":
--- 148,153 ----
          if (fdlist == []):
              continue
!         fd, flags = fdlist[0]
!         if flags & select.POLLHUP:
              line = p.readline()
              if line != "":
***************
*** 152,156 ****
              continue
  
!         elif fdlist[0] == (p.fileno(),select.POLLIN):
              line = p.readline()
              if verbose:
--- 155,159 ----
              continue
  
!         elif flags & select.POLLIN:
              line = p.readline()
              if verbose: