From: Martin v. Löwis Date: Mon, 6 Oct 2003 21:34:33 +0000 (+0000) Subject: Patch #817329: Use SC_OPEN_MAX to determine MAXFD. Backported to 2.3. X-Git-Tag: v2.4a1~1458 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f563c8bbac748e7ca9a1127c67831902bccaee02;p=python Patch #817329: Use SC_OPEN_MAX to determine MAXFD. Backported to 2.3. --- diff --git a/Lib/popen2.py b/Lib/popen2.py index e8fff06e0b..ebb4ef6526 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 = []