We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 608572b commit 12c59daCopy full SHA for 12c59da
1 file changed
vm/src/stdlib/subprocess.rs
@@ -1,4 +1,5 @@
1
use std::cell::RefCell;
2
+use std::ffi::OsString;
3
use std::fs::File;
4
use std::time::Duration;
5
@@ -38,6 +39,8 @@ struct PopenArgs {
38
39
stdout: Option<i64>,
40
#[pyarg(positional_or_keyword, default = "None")]
41
stderr: Option<i64>,
42
+ #[pyarg(positional_or_keyword, default = "None")]
43
+ cwd: Option<PyStringRef>,
44
}
45
46
impl IntoPyObject for subprocess::ExitStatus {
@@ -96,13 +99,15 @@ impl PopenRef {
96
99
.map(|x| objstr::get_value(x))
97
100
.collect(),
98
101
};
102
+ let cwd = args.cwd.map(|x| OsString::from(x.as_str()));
103
104
let process = subprocess::Popen::create(
105
&command_list,
106
subprocess::PopenConfig {
107
stdin,
108
stdout,
109
stderr,
110
+ cwd,
111
..Default::default()
112
},
113
)
0 commit comments