Changeset 1704 for pykota/trunk/bin

Show
Ignore:
Timestamp:
09/06/04 19:05:06 (20 years ago)
Author:
jalet
Message:

Fix for autodetection of SC_OPEN_MAX

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r1643 r1704  
    2424# 
    2525# $Log$ 
     26# Revision 1.71  2004/09/06 17:05:06  jalet 
     27# Fix for autodetection of SC_OPEN_MAX 
     28# 
    2629# Revision 1.70  2004/07/26 09:20:27  jalet 
    2730# Unneeded module 
     
    289292         
    290293    def _run_child(self, cmd): 
    291         for i in range(3, 256): # TODO : MAXFD in original popen2 module 
     294        try : 
     295            MAXFD = os.sysconf("SC_OPEN_MAX") 
     296        except (AttributeError, ValueError) :     
     297            MAXFD = 256 
     298        for i in range(3, MAXFD) :  
    292299            try: 
    293300                os.close(i)