Skip to content

Commit ba7e4ea

Browse files
authored
Update tui.py
1 parent f0b3123 commit ba7e4ea

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

python_agent_harness/tui.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,8 @@ def _run_sessions(self) -> None:
12631263
return
12641264
for f in files:
12651265
try:
1266-
text = open(f, encoding="utf-8").read()
1266+
with open(f, encoding="utf-8") as fh:
1267+
text = fh.read()
12671268
except OSError:
12681269
continue
12691270
meta = SessionStore.parse_metadata(text)
@@ -1302,7 +1303,8 @@ def _run_restore(self, arg: str) -> None:
13021303
self.console.print(f"[red]file not found: {path}[/red]")
13031304
return
13041305
try:
1305-
text = open(path, encoding="utf-8").read()
1306+
with open(path, encoding="utf-8") as fh:
1307+
text = fh.read()
13061308
except OSError as e:
13071309
self.console.print(f"[red]cannot read {path}: {e}[/red]")
13081310
return

0 commit comments

Comments
 (0)