Skip to content

Commit 8e89cfb

Browse files
committed
close the old file prior to opening a new one
1 parent 1eb8056 commit 8e89cfb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pybricksdev/cli/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ async def reconnect_hub():
293293
)
294294
with _get_script_path(args.file) as script_path:
295295
if response == response_options[0]:
296+
args.file.close()
296297
args.file = open(
297298
await hub.race_disconnect(
298299
hub.race_power_button_press(

0 commit comments

Comments
 (0)