package.py : updated logic to log.py rework

Conflicts:
	lib/spack/spack/package.py
This commit is contained in:
alalazo 2016-07-12 18:00:00 +02:00
parent 513cdd580e
commit 813cb032c4

View file

@ -203,8 +203,13 @@ def __exit__(self, exc_type, exception, traceback):
# Flush the log to disk.
sys.stdout.flush()
sys.stderr.flush()
os.dup2(self._stdout, sys.stdout.fileno())
os.dup2(self._stderr, sys.stderr.fileno())
if self.directAssignment:
# We seem to need this only to pass test/install.py
sys.stdout = self._stdout
sys.stderr = self._stderr
else:
os.dup2(self._stdout, sys.stdout.fileno())
os.dup2(self._stderr, sys.stderr.fileno())
# restore output options.
color._force_color = self._force_color