From aabf8faea07e19ed5d8c34c22a278ec7be7248e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 1 Feb 2022 12:26:49 +0100 Subject: [PATCH] profiler: Respect provided output stream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lubomír Sedlář --- pungi/profiler.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pungi/profiler.py b/pungi/profiler.py index cb7488b3..3ffef8b9 100644 --- a/pungi/profiler.py +++ b/pungi/profiler.py @@ -69,10 +69,8 @@ class Profiler(object): @classmethod def print_results(cls, stream=sys.stdout): - print("Profiling results:", file=sys.stdout) + print("Profiling results:", file=stream) results = cls._data.items() results = sorted(results, key=lambda x: x[1]["time"], reverse=True) for name, data in results: - print( - " %6.2f %5d %s" % (data["time"], data["calls"], name), file=sys.stdout - ) + print(" %6.2f %5d %s" % (data["time"], data["calls"], name), file=stream)