Skip to content

Commit

Permalink
cli: fix minor race condition in creating hpi_temp_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Sep 23, 2024
1 parent bf8af6c commit 6a6d157
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions my/core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,8 @@ def main(*, debug: bool) -> None:
# 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

tdir: str = os.path.join(tempfile.gettempdir(), 'hpi_temp_dir')
if not os.path.exists(tdir):
os.makedirs(tdir)
tdir = Path(tempfile.gettempdir()) / 'hpi_temp_dir'
tdir.mkdir(exist_ok=True)
os.chdir(tdir)


Expand Down

0 comments on commit 6a6d157

Please sign in to comment.