diff Lib/multiprocessing/process.py @ 55491:60b31f0db016 3.1

Merged revisions 74063 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k NB: the news item for r73708 seems to have inadvertently been included in a different, unrelated merge set (r74055). I restored it here. ................ r74063 | alexandre.vassalotti | 2009-07-17 08:07:01 -0400 (Fri, 17 Jul 2009) | 17 lines Merged revisions 73694,73708,73738 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r73694 | jesse.noller | 2009-06-29 14:24:26 -0400 (Mon, 29 Jun 2009) | 1 line Issue 5740: multiprocessing.connection.* authkey fixes ........ r73708 | jesse.noller | 2009-06-30 13:11:52 -0400 (Tue, 30 Jun 2009) | 1 line Resolves issues 5155, 5313, 5331 - bad file descriptor error with processes in processes ........ r73738 | r.david.murray | 2009-06-30 22:49:10 -0400 (Tue, 30 Jun 2009) | 2 lines Make punctuation prettier and break up run-on sentence. ........ ................
author R. David Murray <rdmurray@bitdance.com>
date Wed, 29 Jul 2009 15:40:30 +0000
parents 6cc89c60f74d
children 6facbc183a4a
line wrap: on
line diff
--- a/Lib/multiprocessing/process.py	Wed Jul 29 14:16:04 2009 +0000
+++ b/Lib/multiprocessing/process.py	Wed Jul 29 15:40:30 2009 +0000
@@ -221,7 +221,8 @@
             self._counter = itertools.count(1)
             if sys.stdin is not None:
                 try:
-                    os.close(sys.stdin.fileno())
+                    sys.stdin.close()
+                    sys.stdin = open(os.devnull)
                 except (OSError, ValueError):
                     pass
             _current_process = self