diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-02-15 16:25:31 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-02-15 16:25:31 -0800 |
commit | 4862a0c5627e13cb3618779b41ef0fe0edae148b (patch) | |
tree | 0843c710393c9c9adbb33c0f290380c464228077 | |
parent | b39ff144bd47952ee06bba0b549069c635d31a31 (diff) | |
download | portage-4862a0c5627e13cb3618779b41ef0fe0edae148b.tar.gz portage-4862a0c5627e13cb3618779b41ef0fe0edae148b.tar.bz2 portage-4862a0c5627e13cb3618779b41ef0fe0edae148b.zip |
SpawnProcess: use os.open for /dev/null input
-rw-r--r-- | pym/_emerge/SpawnProcess.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py index 05c4768d4..9fbc96472 100644 --- a/pym/_emerge/SpawnProcess.py +++ b/pym/_emerge/SpawnProcess.py @@ -59,8 +59,8 @@ class SpawnProcess(SubProcess): # access to stdin. Until then, use /dev/null so that any # attempts to read from stdin will immediately return EOF # instead of blocking indefinitely. - null_input = open('/dev/null', 'rb') - fd_pipes[0] = null_input.fileno() + null_input = os.open('/dev/null', os.O_RDWR) + fd_pipes[0] = null_input fd_pipes.setdefault(0, sys.stdin.fileno()) fd_pipes.setdefault(1, sys.stdout.fileno()) @@ -123,7 +123,7 @@ class SpawnProcess(SubProcess): os.close(slave_fd) if null_input is not None: - null_input.close() + os.close(null_input) if isinstance(retval, int): # spawn failed |