Fix error with not closed lock file
This commit is contained in:
parent
58b1bb6730
commit
49aa02982b
@ -59,6 +59,8 @@ class CB:
|
|||||||
|
|
||||||
def __del__(self) -> None:
|
def __del__(self) -> None:
|
||||||
if not self.initialized:
|
if not self.initialized:
|
||||||
|
if getattr(self, 'lock_file', False):
|
||||||
|
self.lock_file.close()
|
||||||
return
|
return
|
||||||
|
|
||||||
def unlink(path):
|
def unlink(path):
|
||||||
@ -72,6 +74,7 @@ class CB:
|
|||||||
unlink(self.work_dir / f'mkimage-profiles/conf.d/{PROG}.mk')
|
unlink(self.work_dir / f'mkimage-profiles/conf.d/{PROG}.mk')
|
||||||
|
|
||||||
self.info(f'Finish {PROG}')
|
self.info(f'Finish {PROG}')
|
||||||
|
self.lock_file.close()
|
||||||
|
|
||||||
def expand_path(self, path: PathLike):
|
def expand_path(self, path: PathLike):
|
||||||
result = os.path.expanduser(os.path.expandvars(path))
|
result = os.path.expanduser(os.path.expandvars(path))
|
||||||
|
Loading…
Reference in New Issue
Block a user