From 49aa02982b153f9bcef75841d0eabb8d2b268584 Mon Sep 17 00:00:00 2001 From: Mikhail Gordeev Date: Sat, 18 Apr 2020 02:27:41 +0300 Subject: [PATCH] Fix error with not closed lock file --- cloud_build/cloud_build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cloud_build/cloud_build.py b/cloud_build/cloud_build.py index a2c8bb5..761079a 100755 --- a/cloud_build/cloud_build.py +++ b/cloud_build/cloud_build.py @@ -59,6 +59,8 @@ class CB: def __del__(self) -> None: if not self.initialized: + if getattr(self, 'lock_file', False): + self.lock_file.close() return def unlink(path): @@ -72,6 +74,7 @@ class CB: unlink(self.work_dir / f'mkimage-profiles/conf.d/{PROG}.mk') self.info(f'Finish {PROG}') + self.lock_file.close() def expand_path(self, path: PathLike): result = os.path.expanduser(os.path.expandvars(path))