diff options
author | Jesse Noller <jnoller@gmail.com> | 2009-06-30 17:11:52 +0000 |
---|---|---|
committer | Jesse Noller <jnoller@gmail.com> | 2009-06-30 17:11:52 +0000 |
commit | 1b90efbdc5bb204fe50aea87374603dcba309227 (patch) | |
tree | 42a36dca54321c6caf5e9ca488bdc1be1988b9d2 /Lib/multiprocessing/process.py | |
parent | 0c9eb431491387fc68940e2b24dc873f3147e0c8 (diff) | |
download | cpython-git-1b90efbdc5bb204fe50aea87374603dcba309227.tar.gz |
Resolves issues 5155, 5313, 5331 - bad file descriptor error with processes in processes
Diffstat (limited to 'Lib/multiprocessing/process.py')
-rw-r--r-- | Lib/multiprocessing/process.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py index b034317df0..0b04e36300 100644 --- a/Lib/multiprocessing/process.py +++ b/Lib/multiprocessing/process.py @@ -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 |