aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-10-19 19:56:48 -0400
committerEli Schwartz <eschwartz@archlinux.org>2021-10-26 20:53:43 -0400
commitb1f0eec38f0da1966aaedc7cb1ec2a737e2b7c64 (patch)
treee4826a6c73189bc72a1eb0d46987d7c670e73bf0
parent739de7b088614e811b8f68ab8357e088239aafa7 (diff)
downloadmeson-b1f0eec38f0da1966aaedc7cb1ec2a737e2b7c64.zip
meson-b1f0eec38f0da1966aaedc7cb1ec2a737e2b7c64.tar.gz
meson-b1f0eec38f0da1966aaedc7cb1ec2a737e2b7c64.tar.bz2
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.
-rw-r--r--mesonbuild/mlog.py5
1 files 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,