Skip to content

Commit

Permalink
style: remove breadcrumb code that kept the temporary directory around
Browse files Browse the repository at this point in the history
That code was just there so I could test that my unit test really failed
if the temporary directory was not deleted.
  • Loading branch information
joanise committed Oct 7, 2022
1 parent ab78349 commit af5e085
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions readalongs/web_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,9 @@ async def convert_alignment( # noqa: C901

# Data privacy consideration: we have to make sure this temporary directory gets
# deleted after the call returns, as we promise in the API documentation.
if True:
temp_dir_object = tempfile.TemporaryDirectory()
temp_dir_name = temp_dir_object.name
cleanup = BackgroundTask(temp_dir_object.cleanup)
else:
temp_dir_name = tempfile.mkdtemp()
cleanup = BackgroundTask(lambda: None)
temp_dir_object = tempfile.TemporaryDirectory()
temp_dir_name = temp_dir_object.name
cleanup = BackgroundTask(temp_dir_object.cleanup)
prefix = os.path.join(temp_dir_name, "aligned")
LOGGER.info(f"Temporary directory: {temp_dir_name}")

Expand Down

0 comments on commit af5e085

Please sign in to comment.