do not assign path in context manager as it is deprectated

This commit is contained in:
Evgenii Alekseev 2023-05-04 14:29:00 +03:00
parent c73a6c7bae
commit 2cecbb3d53
3 changed files with 6 additions and 5 deletions

View File

@ -61,7 +61,8 @@ class RemotePull(LazyLogging):
"""
clone repository from remote source
"""
with TemporaryDirectory(ignore_cleanup_errors=True) as dir_name, (clone_dir := Path(dir_name)):
with TemporaryDirectory(ignore_cleanup_errors=True) as dir_name:
clone_dir = Path(dir_name)
Sources.fetch(clone_dir, self.remote_source)
self.repo_copy(clone_dir)

View File

@ -115,7 +115,8 @@ class RemotePush(LazyLogging):
result(Result): build result
"""
try:
with TemporaryDirectory(ignore_cleanup_errors=True) as dir_name, (clone_dir := Path(dir_name)):
with TemporaryDirectory(ignore_cleanup_errors=True) as dir_name:
clone_dir = Path(dir_name)
Sources.fetch(clone_dir, self.remote_source)
Sources.push(clone_dir, self.remote_source, *self.packages_update(result, clone_dir),
commit_author=self.commit_author)

View File

@ -84,10 +84,9 @@ class Executor(Cleaner):
result = Result()
for single in updates:
with self.in_package_context(single.base), \
TemporaryDirectory(ignore_cleanup_errors=True) as dir_name, (build_dir := Path(dir_name)):
with self.in_package_context(single.base), TemporaryDirectory(ignore_cleanup_errors=True) as dir_name:
try:
build_single(single, build_dir)
build_single(single, Path(dir_name))
result.add_success(single)
except Exception:
self.reporter.set_failed(single.base)