Resolves issues 5155, 5313, 5331 - bad file descriptor error with processes in processes

This commit is contained in:
Jesse Noller 2009-06-30 17:11:52 +00:00
parent 0c9eb43149
commit 1b90efbdc5
5 changed files with 110 additions and 2 deletions

View file

@ -220,7 +220,8 @@ class Process(object):
self._children = set()
self._counter = itertools.count(1)
try:
os.close(sys.stdin.fileno())
sys.stdin.close()
sys.stdin = open(os.devnull)
except (OSError, ValueError):
pass
_current_process = self