mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-04-27 00:56:23 +00:00
Use Path.save for saving the fixtures (#894)
This might fix saving of fixture files on Windows, but it's a good practice to use pathlib where possible.
This commit is contained in:
parent
5b486074e2
commit
88381f270f
@ -164,7 +164,7 @@ async def handle_device(basedir, autosave, device: Device, batch_size: int):
|
|||||||
if save == "y":
|
if save == "y":
|
||||||
click.echo(f"Saving info to {save_filename}")
|
click.echo(f"Saving info to {save_filename}")
|
||||||
|
|
||||||
with open(save_filename, "w") as f:
|
with save_filename.open("w") as f:
|
||||||
json.dump(fixture_result.data, f, sort_keys=True, indent=4)
|
json.dump(fixture_result.data, f, sort_keys=True, indent=4)
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user