[Python-checkins] r47078 - python/branches/release24-maint/Lib/popen2.py python/branches/release24-maint/Lib/subprocess.py

peter.astrand python-checkins at python.org
Thu Jun 22 22:28:33 CEST 2006


Author: peter.astrand
Date: Thu Jun 22 22:28:33 2006
New Revision: 47078

Modified:
   python/branches/release24-maint/Lib/popen2.py
   python/branches/release24-maint/Lib/subprocess.py
Log:
Applied patch #1506758: Prevent MemoryErrors with large MAXFD. Backport of 47077.

Modified: python/branches/release24-maint/Lib/popen2.py
==============================================================================
--- python/branches/release24-maint/Lib/popen2.py	(original)
+++ python/branches/release24-maint/Lib/popen2.py	Thu Jun 22 22:28:33 2006
@@ -65,7 +65,7 @@
     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:

Modified: python/branches/release24-maint/Lib/subprocess.py
==============================================================================
--- python/branches/release24-maint/Lib/subprocess.py	(original)
+++ python/branches/release24-maint/Lib/subprocess.py	Thu Jun 22 22:28:33 2006
@@ -867,7 +867,7 @@
 
 
         def _close_fds(self, but):
-            for i in range(3, MAXFD):
+            for i in xrange(3, MAXFD):
                 if i == but:
                     continue
                 try:


More information about the Python-checkins mailing list