From f563c8bbac748e7ca9a1127c67831902bccaee02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 6 Oct 2003 21:34:33 +0000 Subject: [PATCH] Patch #817329: Use SC_OPEN_MAX to determine MAXFD. Backported to 2.3. --- Lib/popen2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/popen2.py b/Lib/popen2.py index e8fff06e0b6..ebb4ef65267 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 = []