fix(keyringctl): restore cwd before deleting the temporary working dir
This avoids potential issues with wrapped runtime like ipython or pdb that try to invoke functions at exit and access the current working directory, which will ultimately lead to an error in case we deleted it before changing the current working directory.
This commit is contained in:
parent
92f07f0d4b
commit
a0199b0b04
@ -1074,9 +1074,8 @@ if __name__ == '__main__':
|
||||
# temporary working directory that gets auto cleaned
|
||||
with TemporaryDirectory() as tempdir:
|
||||
working_dir = Path(tempdir)
|
||||
chdir(working_dir)
|
||||
debug(f'Working directory: {working_dir}')
|
||||
|
||||
with cwd(working_dir):
|
||||
if args.subcommand in ["convert", "import"]:
|
||||
if args.target:
|
||||
args.target.mkdir(parents=True, exist_ok=True)
|
||||
|
Loading…
Reference in New Issue
Block a user