diff options
Diffstat (limited to 'numpy/distutils')
-rw-r--r-- | numpy/distutils/tests/test_exec_command.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/distutils/tests/test_exec_command.py b/numpy/distutils/tests/test_exec_command.py index 9b1a9e5d0..11f262369 100644 --- a/numpy/distutils/tests/test_exec_command.py +++ b/numpy/distutils/tests/test_exec_command.py @@ -20,6 +20,8 @@ class redirect_stdout(object): def __exit__(self, exc_type, exc_value, traceback): self._stdout.flush() sys.stdout = self.old_stdout + # note: closing sys.stdout won't close it. + self._stdout.close() class redirect_stderr(object): """Context manager to redirect stderr for exec_command test.""" @@ -33,6 +35,8 @@ class redirect_stderr(object): def __exit__(self, exc_type, exc_value, traceback): self._stderr.flush() sys.stderr = self.old_stderr + # note: closing sys.stderr won't close it. + self._stderr.close() class emulate_nonposix(object): """Context manager to emulate os.name != 'posix' """ |