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

clean-up .old folder if an exception happens

Fixes: openSUSE/obs-build#920
This commit is contained in:
Martin Liska 2023-04-14 13:51:01 +02:00
parent 6e4fcfe315
commit a01d2a43df

View File

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