@@ -1181,7 +1181,7 @@ pub(crate) enum RunCommand {
11811181 /// [zipapp]: <https://docs.python.org/3/library/zipapp.html>
11821182 PythonZipapp ( PathBuf , Vec < OsString > ) ,
11831183 /// Execute a `python` script provided via `stdin`.
1184- PythonStdin ( Vec < u8 > ) ,
1184+ PythonStdin ( Vec < u8 > , Vec < OsString > ) ,
11851185 /// Execute a Python script provided via a remote URL.
11861186 PythonRemote ( tempfile:: NamedTempFile , Vec < OsString > ) ,
11871187 /// Execute an external command.
@@ -1208,7 +1208,7 @@ impl RunCommand {
12081208 Cow :: Borrowed ( "python" )
12091209 }
12101210 }
1211- Self :: PythonStdin ( _ ) => Cow :: Borrowed ( "python -c" ) ,
1211+ Self :: PythonStdin ( .. ) => Cow :: Borrowed ( "python -c" ) ,
12121212 Self :: External ( executable, _) => executable. to_string_lossy ( ) ,
12131213 }
12141214 }
@@ -1261,7 +1261,7 @@ impl RunCommand {
12611261 process. args ( args) ;
12621262 process
12631263 }
1264- Self :: PythonStdin ( script) => {
1264+ Self :: PythonStdin ( script, args ) => {
12651265 let mut process = Command :: new ( interpreter. sys_executable ( ) ) ;
12661266 process. arg ( "-c" ) ;
12671267
@@ -1276,6 +1276,7 @@ impl RunCommand {
12761276 let script = String :: from_utf8 ( script. clone ( ) ) . expect ( "script is valid UTF-8" ) ;
12771277 process. arg ( script) ;
12781278 }
1279+ process. args ( args) ;
12791280
12801281 process
12811282 }
@@ -1414,7 +1415,7 @@ impl RunCommand {
14141415 if target. eq_ignore_ascii_case ( "-" ) {
14151416 let mut buf = Vec :: with_capacity ( 1024 ) ;
14161417 std:: io:: stdin ( ) . read_to_end ( & mut buf) ?;
1417- Ok ( Self :: PythonStdin ( buf) )
1418+ Ok ( Self :: PythonStdin ( buf, args . to_vec ( ) ) )
14181419 } else if target. eq_ignore_ascii_case ( "python" ) {
14191420 Ok ( Self :: Python ( args. to_vec ( ) ) )
14201421 } else if target_path
0 commit comments