diff --git a/avocado/utils/process.py b/avocado/utils/process.py index 517e34d90c24181e88969a82bf2845e5e887a716..9a00d6328801cbf853b1e1491746d3d23a5c0b93 100644 --- a/avocado/utils/process.py +++ b/avocado/utils/process.py @@ -418,7 +418,7 @@ class FDDrainer(object): # and other logging handlers (custom ones?) also have # the same interface, so let's try to use it if available stream = getattr(handler, 'stream', None) - if stream is not None: + if (stream is not None) and (not stream.closed): os.fsync(stream.fileno()) if hasattr(handler, 'close'): handler.close()