Skip to content
Snippets Groups Projects
Commit 42a86b05 authored by Campbell Barton's avatar Campbell Barton
Browse files

Cleanup: use the assignment operator with list-comprehension

parent 4d28fe27
Branches
Tags
No related merge requests found
......@@ -97,10 +97,12 @@ def run(args, *, quiet):
# Build System Access
def cmake_cache_var(cmake_dir, var):
cache_file = open(os.path.join(cmake_dir, "CMakeCache.txt"), encoding='utf-8')
lines = [l_strip for l in cache_file for l_strip in (l.strip(),)
if l_strip if not l_strip.startswith("//") if not l_strip.startswith("#")]
cache_file.close()
with open(os.path.join(cmake_dir, "CMakeCache.txt"), encoding='utf-8') as cache_file:
lines = [
l_strip for l in cache_file
if (l_strip := l.strip())
if not l_strip.startswith(("//", "#"))
]
for l in lines:
if l.split(":")[0] == var:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment