From b1f0eec38f0da1966aaedc7cb1ec2a737e2b7c64 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 19 Oct 2021 19:56:48 -0400 Subject: fix lgtm.com "Use of the return value of a procedure" we return _log even though this entire family of functions returns None, because a side effect of returning is that the other version of the function is not run. We can do that more obviously, using an else clause that doesn't attach meaning to return values. --- mesonbuild/mlog.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index 18cbc48..8347f2d 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -251,8 +251,9 @@ def cmd_ci_include(file: str) -> None: def log(*args: TV_Loggable, is_error: bool = False, once: bool = False, **kwargs: T.Any) -> None: if once: - return log_once(*args, is_error=is_error, **kwargs) - return _log(*args, is_error=is_error, **kwargs) + log_once(*args, is_error=is_error, **kwargs) + else: + _log(*args, is_error=is_error, **kwargs) def _log(*args: TV_Loggable, is_error: bool = False, -- cgit v1.1