diff options
author | Peter Astrand <astrand@lysator.liu.se> | 2006-06-22 20:21:26 +0000 |
---|---|---|
committer | Peter Astrand <astrand@lysator.liu.se> | 2006-06-22 20:21:26 +0000 |
commit | ff355f1adaa423c143c169221bd4a80775adf8bb (patch) | |
tree | 2c9a7a74ff9201d25e60c720fcf59a830eb27006 | |
parent | d6b2430b7a99110119743b8529b66c39d1fed722 (diff) | |
download | cpython-git-ff355f1adaa423c143c169221bd4a80775adf8bb.tar.gz |
Applied patch #1506758: Prevent MemoryErrors with large MAXFD.
-rw-r--r-- | Lib/popen2.py | 2 | ||||
-rw-r--r-- | Lib/subprocess.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/popen2.py b/Lib/popen2.py index b966d4c80e..6f56a926e9 100644 --- a/Lib/popen2.py +++ b/Lib/popen2.py @@ -79,7 +79,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 a281cd8f22..9c9cd69df2 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -941,7 +941,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: |