@@ -1181,7 +1181,7 @@ pub(crate) enum RunCommand {
1181
1181
/// [zipapp]: <https://docs.python.org/3/library/zipapp.html>
1182
1182
PythonZipapp ( PathBuf , Vec < OsString > ) ,
1183
1183
/// Execute a `python` script provided via `stdin`.
1184
- PythonStdin ( Vec < u8 > ) ,
1184
+ PythonStdin ( Vec < u8 > , Vec < OsString > ) ,
1185
1185
/// Execute a Python script provided via a remote URL.
1186
1186
PythonRemote ( tempfile:: NamedTempFile , Vec < OsString > ) ,
1187
1187
/// Execute an external command.
@@ -1208,7 +1208,7 @@ impl RunCommand {
1208
1208
Cow :: Borrowed ( "python" )
1209
1209
}
1210
1210
}
1211
- Self :: PythonStdin ( _ ) => Cow :: Borrowed ( "python -c" ) ,
1211
+ Self :: PythonStdin ( .. ) => Cow :: Borrowed ( "python -c" ) ,
1212
1212
Self :: External ( executable, _) => executable. to_string_lossy ( ) ,
1213
1213
}
1214
1214
}
@@ -1261,7 +1261,7 @@ impl RunCommand {
1261
1261
process. args ( args) ;
1262
1262
process
1263
1263
}
1264
- Self :: PythonStdin ( script) => {
1264
+ Self :: PythonStdin ( script, args ) => {
1265
1265
let mut process = Command :: new ( interpreter. sys_executable ( ) ) ;
1266
1266
process. arg ( "-c" ) ;
1267
1267
@@ -1276,6 +1276,7 @@ impl RunCommand {
1276
1276
let script = String :: from_utf8 ( script. clone ( ) ) . expect ( "script is valid UTF-8" ) ;
1277
1277
process. arg ( script) ;
1278
1278
}
1279
+ process. args ( args) ;
1279
1280
1280
1281
process
1281
1282
}
@@ -1414,7 +1415,7 @@ impl RunCommand {
1414
1415
if target. eq_ignore_ascii_case ( "-" ) {
1415
1416
let mut buf = Vec :: with_capacity ( 1024 ) ;
1416
1417
std:: io:: stdin ( ) . read_to_end ( & mut buf) ?;
1417
- Ok ( Self :: PythonStdin ( buf) )
1418
+ Ok ( Self :: PythonStdin ( buf, args . to_vec ( ) ) )
1418
1419
} else if target. eq_ignore_ascii_case ( "python" ) {
1419
1420
Ok ( Self :: Python ( args. to_vec ( ) ) )
1420
1421
} else if target_path
0 commit comments