Skip to content

Commit 98a6659

Browse files
committed
fix to open the file properly as a stream as _get_script_path expects
1 parent 58ba725 commit 98a6659

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

pybricksdev/cli/__init__.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,21 +284,23 @@ async def reconnect_hub():
284284
"Would you like to re-compile your code?",
285285
response_options,
286286
default=(
287-
response_options[0]
287+
response_options[1]
288288
if args.start
289-
else response_options[1]
289+
else response_options[2]
290290
),
291291
).ask_async()
292292
)
293293
)
294294
with _get_script_path(args.file) as script_path:
295295
if response == response_options[0]:
296-
args.file = os.path.abspath(
297-
await hub.race_disconnect(
298-
hub.race_power_button_press(
299-
questionary.path(
300-
"What file would you like to use?"
301-
).ask_async()
296+
args.file = open(
297+
os.path.abspath(
298+
await hub.race_disconnect(
299+
hub.race_power_button_press(
300+
questionary.path(
301+
"What file would you like to use?"
302+
).ask_async()
303+
)
302304
)
303305
)
304306
)

0 commit comments

Comments
 (0)