summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-10-06 21:34:33 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-10-06 21:34:33 (GMT)
commitf563c8bbac748e7ca9a1127c67831902bccaee02 (patch)
tree84829f0e3688269420d4197713fb90034de55a4e /Lib
parent0a4a50dd85fb1f9f30ec6e6ff62c71124c52ade6 (diff)
downloadcpython-f563c8bbac748e7ca9a1127c67831902bccaee02.zip
cpython-f563c8bbac748e7ca9a1127c67831902bccaee02.tar.gz
cpython-f563c8bbac748e7ca9a1127c67831902bccaee02.tar.bz2
Patch #817329: Use SC_OPEN_MAX to determine MAXFD. Backported to 2.3.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/popen2.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/popen2.py b/Lib/popen2.py
index e8fff06..ebb4ef6 100644
--- a/Lib/popen2.py
+++ b/Lib/popen2.py
@@ -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 = []