Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Sep 12, 2024
1 parent 63f1e91 commit d37dbe5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sdsstools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ async def __aexit__(self, exc_type, exc_value, traceback):
return False

Check warning on line 168 in src/sdsstools/utils.py

View check run for this annotation

Codecov / codecov/patch

src/sdsstools/utils.py#L168

Added line #L168 was not covered by tests

await asyncio.gather(*self._tasks)
self._joined = True

def create_task(self, coro):
"""Creates a task and appends it to the list of tasks."""
Expand All @@ -180,7 +181,7 @@ def create_task(self, coro):
def results(self):
"""Returns the results of the tasks in the same order they were created."""

if self._joined:
if not self._joined:
raise RuntimeError("Tasks have not been gathered yet.")

return [task.result() for task in self._tasks]
Expand Down

0 comments on commit d37dbe5

Please sign in to comment.