]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Applied patch #1506758: Prevent MemoryErrors with large MAXFD. Backport of 47077.
authorPeter Astrand <astrand@lysator.liu.se>
Thu, 22 Jun 2006 20:28:33 +0000 (20:28 +0000)
committerPeter Astrand <astrand@lysator.liu.se>
Thu, 22 Jun 2006 20:28:33 +0000 (20:28 +0000)
Lib/popen2.py
Lib/subprocess.py

index 54543bed0f8d355c72ec37a09b0dbb2ede7b45fd..fe3aa7e16751053990a29f423f71911575340179 100644 (file)
@@ -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:
index 2750f79663b7328d2df0b95c0609e91fd58ccdd3..e1b0c1f43da9ce31b41b917e42762a472c0eb570 100644 (file)
@@ -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: