From: Peter Astrand Date: Thu, 22 Jun 2006 20:28:33 +0000 (+0000) Subject: Applied patch #1506758: Prevent MemoryErrors with large MAXFD. Backport of 47077. X-Git-Tag: v2.4.4c1~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=651752502ef4154f52a946b58d6523df4d1ffdb2;p=thirdparty%2FPython%2Fcpython.git Applied patch #1506758: Prevent MemoryErrors with large MAXFD. Backport of 47077. --- diff --git a/Lib/popen2.py b/Lib/popen2.py index 54543bed0f8d..fe3aa7e16751 100644 --- a/Lib/popen2.py +++ b/Lib/popen2.py @@ -65,7 +65,7 @@ class Popen3: def _run_child(self, cmd): if isinstance(cmd, basestring): cmd = ['/bin/sh', '-c', cmd] - for i in range(3, MAXFD): + for i in xrange(3, MAXFD): try: os.close(i) except OSError: diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 2750f79663b7..e1b0c1f43da9 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -867,7 +867,7 @@ class Popen(object): def _close_fds(self, but): - for i in range(3, MAXFD): + for i in xrange(3, MAXFD): if i == but: continue try: