Commit c8253040 authored by Peter Astrand's avatar Peter Astrand

Applied patch #1506758: Prevent MemoryErrors with large MAXFD.

parent 66383435
...@@ -79,7 +79,7 @@ class Popen3: ...@@ -79,7 +79,7 @@ class Popen3:
def _run_child(self, cmd): def _run_child(self, cmd):
if isinstance(cmd, basestring): if isinstance(cmd, basestring):
cmd = ['/bin/sh', '-c', cmd] cmd = ['/bin/sh', '-c', cmd]
for i in range(3, MAXFD): for i in xrange(3, MAXFD):
try: try:
os.close(i) os.close(i)
except OSError: except OSError:
......
...@@ -941,7 +941,7 @@ class Popen(object): ...@@ -941,7 +941,7 @@ class Popen(object):
def _close_fds(self, but): def _close_fds(self, but):
for i in range(3, MAXFD): for i in xrange(3, MAXFD):
if i == but: if i == but:
continue continue
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment