Skip to content

Commit 4b1425a

Browse files
committed
chore(ruff): Manual fixes for cli/freeze.py
src/tmuxp/cli/import_config.py:156:15: SIM115 Use context handler for opening files
1 parent 58b6b47 commit 4b1425a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/tmuxp/cli/import_config.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,8 @@ def import_config(
153153
if prompt_yes_no("Save to %s?" % dest_path):
154154
dest = dest_path
155155

156-
buf = open(dest, "w")
157-
buf.write(new_config)
158-
buf.close()
156+
with open(dest, "w") as buf:
157+
buf.write(new_config)
159158

160159
tmuxp_echo("Saved to %s." % dest)
161160
else:

0 commit comments

Comments
 (0)