From ecdda25a3bad37b9769e4defa93e8e26c547a1b9 Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Thu, 19 Jan 2023 21:43:25 +0100 Subject: [PATCH] Add comment. --- vulture/core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vulture/core.py b/vulture/core.py index ff52abb6..16c71948 100644 --- a/vulture/core.py +++ b/vulture/core.py @@ -386,11 +386,13 @@ def unused_attrs(self): def _log(self, *args, file=None, force=False): if self.verbose or force: + file = file or sys.stdout try: - print(*args, file=file if file else sys.stdout) + print(*args, file=file) except UnicodeEncodeError: + # Some terminals can't print Unicode symbols. x = " ".join(map(str, args)) - print(x.encode(), file=file if file else sys.stdout) + print(x.encode(), file=file) def _add_aliases(self, node): """