From 0263d3ec3714131acaa17900c6d620a5a2064c7c Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Wed, 8 Jan 2020 10:04:38 +0100 Subject: [PATCH] Removed now unused get_output_stream method Signed-off-by: Bastian Venthur --- compose/cli/log_printer.py | 3 +-- compose/parallel.py | 3 +-- compose/progress_stream.py | 2 +- compose/utils.py | 4 ---- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/compose/cli/log_printer.py b/compose/cli/log_printer.py index fd193000f..100f3a825 100644 --- a/compose/cli/log_printer.py +++ b/compose/cli/log_printer.py @@ -9,7 +9,6 @@ from threading import Thread from docker.errors import APIError from . import colors -from compose import utils from compose.cli.signals import ShutdownException from compose.utils import split_buffer @@ -64,7 +63,7 @@ class LogPrinter(object): self.containers = containers self.presenters = presenters self.event_stream = event_stream - self.output = utils.get_output_stream(output) + self.output = output self.cascade_stop = cascade_stop self.log_args = log_args or {} diff --git a/compose/parallel.py b/compose/parallel.py index 6ef9ceedd..15c3ad572 100644 --- a/compose/parallel.py +++ b/compose/parallel.py @@ -18,7 +18,6 @@ from compose.const import PARALLEL_LIMIT from compose.errors import HealthCheckFailed from compose.errors import NoHealthCheckConfigured from compose.errors import OperationFailedError -from compose.utils import get_output_stream log = logging.getLogger(__name__) @@ -82,7 +81,7 @@ def parallel_execute(objects, func, get_name, msg, get_deps=None, limit=None, fa in the CLI logs, but don't raise an exception (such as attempting to start 0 containers) """ objects = list(objects) - stream = get_output_stream(sys.stderr) + stream = sys.stderr if ParallelStreamWriter.instance: writer = ParallelStreamWriter.instance diff --git a/compose/progress_stream.py b/compose/progress_stream.py index 0ae0dc316..8792ff287 100644 --- a/compose/progress_stream.py +++ b/compose/progress_stream.py @@ -15,7 +15,7 @@ def write_to_stream(s, stream): def stream_output(output, stream): is_terminal = hasattr(stream, 'isatty') and stream.isatty() - stream = utils.get_output_stream(stream) + stream = stream lines = {} diff = 0 diff --git a/compose/utils.py b/compose/utils.py index 9170abc13..8b5ab38d9 100644 --- a/compose/utils.py +++ b/compose/utils.py @@ -16,10 +16,6 @@ json_decoder = json.JSONDecoder() log = logging.getLogger(__name__) -def get_output_stream(stream): - return stream - - def stream_as_text(stream): """Given a stream of bytes or text, if any of the items in the stream are bytes convert them to text.