Skip to content

Commit

Permalink
Handle case where Python main script is undefined
Browse files Browse the repository at this point in the history
In the Python runtime's launch function, we don't fail fast when the
mainProgram is null, because there are cases where you might want that,
such as running `python -i` to bring up the REPL. So let's not print
"null" for the main program name in that case, but rather omit it.
  • Loading branch information
ctrueden committed Jan 10, 2025
1 parent e0a9309 commit 1ed58f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/python.kt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class PythonRuntimeConfig(recognizedArgs: Array<String>) :
dryRun(buildString {
append(python?.binPython ?: "python")
args.runtime.forEach { append(" $it") }
append(" $mainProgram")
if (mainProgram != null) append(" $mainProgram")
args.main.forEach { append(" $it") }
})

Expand Down

0 comments on commit 1ed58f9

Please sign in to comment.