diff options
author | Dylan Simon <dylan@dylex.net> | 2021-08-03 00:39:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-02 21:39:38 -0700 |
commit | 507d3c841cd2c8c0120aa1928ea25be930857f9c (patch) | |
tree | 80c49732f3be089876930a52c71cf866ef975916 /lib | |
parent | 2dd2a5b167e70ad875fe0e424baed0e38c57c9ec (diff) | |
download | spack-507d3c841cd2c8c0120aa1928ea25be930857f9c.tar.gz spack-507d3c841cd2c8c0120aa1928ea25be930857f9c.tar.bz2 spack-507d3c841cd2c8c0120aa1928ea25be930857f9c.tar.xz spack-507d3c841cd2c8c0120aa1928ea25be930857f9c.zip |
don't spin writer daemon when < /dev/null (#25170)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/llnl/util/tty/log.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/spack/llnl/util/tty/log.py b/lib/spack/llnl/util/tty/log.py index f081893c85..bc79b32335 100644 --- a/lib/spack/llnl/util/tty/log.py +++ b/lib/spack/llnl/util/tty/log.py @@ -533,13 +533,15 @@ class log_output(object): # Sets a daemon that writes to file what it reads from a pipe try: # need to pass this b/c multiprocessing closes stdin in child. + input_multiprocess_fd = None try: - input_multiprocess_fd = MultiProcessFd( - os.dup(sys.stdin.fileno()) - ) + if sys.stdin.isatty(): + input_multiprocess_fd = MultiProcessFd( + os.dup(sys.stdin.fileno()) + ) except BaseException: # just don't forward input if this fails - input_multiprocess_fd = None + pass with replace_environment(self.env): self.process = multiprocessing.Process( |