File tree Expand file tree Collapse file tree
testbed/app/src/main/java/org/python/testbed Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -625,7 +625,8 @@ async def read_int(size):
625625 except ValueError :
626626 priority = LogPriority .UNKNOWN
627627
628- payload_fields = (await read_bytes (payload_len - 1 )).split (b"\0 " )
628+ payload = await read_bytes (payload_len - 1 )
629+ payload_fields = payload .split (b"\0 " )
629630 if len (payload_fields ) < 2 :
630631 raise ValueError (
631632 f"payload { payload !r} does not contain at least 2 "
Original file line number Diff line number Diff line change @@ -28,12 +28,11 @@ class PythonTestRunner(val context: Context) {
2828 * @param args Python command-line, encoded as JSON.
2929 * @return The Python exit status: zero on success, nonzero on failure. */
3030 fun run (args : String ) : Int {
31- // We leave argument 0 as an empty string, which is a placeholder for the
32- // executable name in embedded mode.
31+ // Argument 0 is a placeholder for the executable name in embedded mode.
3332 val argsJsonArray = JSONArray (args)
34- val argsStringArray = Array <String >(argsJsonArray.length() + 1 ) { it -> " " }
35- for (i in 0 .. < argsJsonArray.length()) {
36- argsStringArray[i + 1 ] = argsJsonArray.getString(i)
33+ val argsStringArray = Array <String >(argsJsonArray.length() + 1 ) { i ->
34+ if (i == 0 ) " "
35+ else argsJsonArray.getString(i - 1 )
3736 }
3837
3938 // Python needs this variable to help it find the temporary directory,
You can’t perform that action at this time.
0 commit comments