summaryrefslogtreecommitdiffstats
path: root/pym/portage/process.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-12-15 14:04:28 -0800
committerZac Medico <zmedico@gentoo.org>2012-12-15 14:04:28 -0800
commit0db4c2a0f8b80b3f08a9a1f068a8cd0b2ff1fe4f (patch)
treec204d69eae88d5977ed70fdf32df3ee00b19680b /pym/portage/process.py
parente91e0dac2fbcec4ebb42af29e2914a120341eefa (diff)
downloadportage-0db4c2a0f8b80b3f08a9a1f068a8cd0b2ff1fe4f.tar.gz
portage-0db4c2a0f8b80b3f08a9a1f068a8cd0b2ff1fe4f.tar.bz2
portage-0db4c2a0f8b80b3f08a9a1f068a8cd0b2ff1fe4f.zip
Handle closed sys.__stdin__, for multiprocessing
Buggy code in python's multiprocessing/process.py closes sys.stdin and reassigns it to open(os.devnull), but fails to update the corresponding __stdin__ reference. So, detect that case and handle it appropriately. The buggy code is visible in http://hg.python.org/lookup/r73708.
Diffstat (limited to 'pym/portage/process.py')
-rw-r--r--pym/portage/process.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pym/portage/process.py b/pym/portage/process.py
index fbfbde049..63c315423 100644
--- a/pym/portage/process.py
+++ b/pym/portage/process.py
@@ -226,7 +226,7 @@ def spawn(mycommand, env={}, opt_name=None, fd_pipes=None, returnpid=False,
# default to propagating our stdin, stdout and stderr.
if fd_pipes is None:
fd_pipes = {
- 0:sys.__stdin__.fileno(),
+ 0:portage._get_stdin().fileno(),
1:sys.__stdout__.fileno(),
2:sys.__stderr__.fileno(),
}