1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 01:46:13 +01:00

Merge pull request #1301 from marxin/fix-old-folder

clean-up .old folder if an exception happens
This commit is contained in:
Daniel Mach 2023-04-17 14:22:38 +02:00 committed by GitHub
commit e299ab98bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -444,7 +444,9 @@ class Serviceinfo:
msg = f'"{old_dir}" exists, please remove it'
raise oscerr.OscIOError(None, msg)
try:
result = self._execute(dir, old_dir, callmode, singleservice, verbose)
finally:
shutil.rmtree(old_dir)
return result