Skip to content

Commit b7b9e3e

Browse files
authored
Merge pull request #3000 from vkarak/bugfix/autodetect-rm-workdir-on-error
[bugfix] Always remove temporary directory when remote auto-detection fails
2 parents 78b1109 + d566100 commit b7b9e3e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

reframe/frontend/autodetect.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def __enter__(self):
5959
shutil.copy2(src, self._workdir)
6060
except FileNotFoundError:
6161
use_pip = True
62+
except Exception as err:
63+
osext.rmtree(self._workdir)
64+
raise err
6265

6366
return self._workdir, use_pip
6467

0 commit comments

Comments
 (0)