summaryrefslogtreecommitdiff
path: root/mesonbuild/cmake
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2023-12-25 02:42:55 -0500
committerEli Schwartz <eschwartz93@gmail.com>2024-07-30 14:13:11 -0400
commitf2de6dfd1041ef2e62b41d437da2d62af4a4d437 (patch)
treebed0807493b7b93d64f377239144cf333fc62120 /mesonbuild/cmake
parent433c13c5c4e72e5d04d6955b790c548bf7e2ad24 (diff)
downloadmeson-f2de6dfd1041ef2e62b41d437da2d62af4a4d437.tar.gz
mypy: fix broken logic checks that used "if func"
It's always true because the func is always a real, truthy func object. In the cmake case, the logic seems to be broken because if a path is not a file, then that includes the case where it does not exist. It also clearly meant "or" instead of "and". What actually ended up happening was that this check never fired at all. Because "if not func and not ..." would always fail, because "not func" is always false. Maybe we don't need this logic at all...
Diffstat (limited to 'mesonbuild/cmake')
-rw-r--r--mesonbuild/cmake/traceparser.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/cmake/traceparser.py b/mesonbuild/cmake/traceparser.py
index 69e413182..bc18b51a5 100644
--- a/mesonbuild/cmake/traceparser.py
+++ b/mesonbuild/cmake/traceparser.py
@@ -165,7 +165,7 @@ class CMakeTraceParser:
def parse(self, trace: T.Optional[str] = None) -> None:
# First load the trace (if required)
if not self.requires_stderr():
- if not self.trace_file_path.exists and not self.trace_file_path.is_file():
+ if not self.trace_file_path.is_file():
raise CMakeException(f'CMake: Trace file "{self.trace_file_path!s}" not found')
trace = self.trace_file_path.read_text(errors='ignore', encoding='utf-8')
if not trace: