]> granicus.if.org Git - python/commitdiff
Patch #817329: Use SC_OPEN_MAX to determine MAXFD. Backported to 2.3.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 6 Oct 2003 21:34:33 +0000 (21:34 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 6 Oct 2003 21:34:33 +0000 (21:34 +0000)
Lib/popen2.py

index e8fff06e0b603e59e65cb21219068ab284041941..ebb4ef652670a885e17c454a93a3d632b610d07f 100644 (file)
@@ -11,7 +11,10 @@ import sys
 
 __all__ = ["popen2", "popen3", "popen4"]
 
-MAXFD = 256     # Max number of file descriptors (os.getdtablesize()???)
+try:
+    MAXFD = os.sysconf('SC_OPEN_MAX')
+except (AttributeError, ValueError):
+    MAXFD = 256
 
 _active = []