Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/cmake/project_info.py')
-rwxr-xr-xbuild_files/cmake/project_info.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/build_files/cmake/project_info.py b/build_files/cmake/project_info.py
index 5980d48f85d..dd81602630e 100755
--- a/build_files/cmake/project_info.py
+++ b/build_files/cmake/project_info.py
@@ -220,14 +220,12 @@ def cmake_advanced_info():
def cmake_cache_var(var):
- cache_file = open(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(("//", "#"))
- ]
- 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: