diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2003-10-06 21:34:33 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2003-10-06 21:34:33 (GMT) |
commit | f563c8bbac748e7ca9a1127c67831902bccaee02 (patch) | |
tree | 84829f0e3688269420d4197713fb90034de55a4e | |
parent | 0a4a50dd85fb1f9f30ec6e6ff62c71124c52ade6 (diff) | |
download | cpython-f563c8bbac748e7ca9a1127c67831902bccaee02.zip cpython-f563c8bbac748e7ca9a1127c67831902bccaee02.tar.gz cpython-f563c8bbac748e7ca9a1127c67831902bccaee02.tar.bz2 |
Patch #817329: Use SC_OPEN_MAX to determine MAXFD. Backported to 2.3.
-rw-r--r-- | Lib/popen2.py | 5 |
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 = [] |