Skip to content

Commit

Permalink
hackfix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Nov 29, 2024
1 parent 59caaad commit 95ad743
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ def _get_tcs(evo: EvohomeClientNew, loc_idx: int | None) -> ControlSystem:
async def _write(output_file: TextIOWrapper | Any, content: str) -> None:
"""Write to a file, async if possible and sync otherwise."""

try:
if output_file.name == "<stdout>":
output_file.write(content)
else:
async with aiofiles.open(output_file.name, "w") as fp:
await fp.write(content)
except TypeError: # if output_file is sys.stdout:
output_file.write(content)


@click.group()
Expand Down

0 comments on commit 95ad743

Please sign in to comment.