cli: fix minor race condition in creating hpi_temp_dir
This commit is contained in:
parent
bf8af6c598
commit
6a6d157040
1 changed files with 2 additions and 3 deletions
|
@ -615,9 +615,8 @@ def main(*, debug: bool) -> None:
|
||||||
# to run things at the end (would need to use a callback or pass context)
|
# to run things at the end (would need to use a callback or pass context)
|
||||||
# https://click.palletsprojects.com/en/7.x/commands/#nested-handling-and-contexts
|
# https://click.palletsprojects.com/en/7.x/commands/#nested-handling-and-contexts
|
||||||
|
|
||||||
tdir: str = os.path.join(tempfile.gettempdir(), 'hpi_temp_dir')
|
tdir = Path(tempfile.gettempdir()) / 'hpi_temp_dir'
|
||||||
if not os.path.exists(tdir):
|
tdir.mkdir(exist_ok=True)
|
||||||
os.makedirs(tdir)
|
|
||||||
os.chdir(tdir)
|
os.chdir(tdir)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue