Skip to content

Commit 98e3d26

Browse files
committed
Use PyPathLike::into_cstring
1 parent 04821ce commit 98e3d26

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vm/src/stdlib/posix.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,10 @@ pub mod module {
12781278
fn spawn(self, spawnp: bool, vm: &VirtualMachine) -> PyResult<libc::pid_t> {
12791279
use crate::TryFromBorrowedObject;
12801280

1281-
let path = CString::new(self.path.clone().into_bytes())
1281+
let path = self
1282+
.path
1283+
.clone()
1284+
.into_cstring(vm)
12821285
.map_err(|_| vm.new_value_error("path should not have nul bytes".to_owned()))?;
12831286

12841287
let mut file_actions = unsafe {

0 commit comments

Comments
 (0)