Skip to content

Commit 97b991b

Browse files
committed
Fix PyCSimple
1 parent ff68bd1 commit 97b991b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

crates/vm/src/stdlib/ctypes/base.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,12 @@ impl Constructor for PyCSimple {
218218
_ => vm.ctx.none(), // "z" | "Z" | "P"
219219
}
220220
};
221-
Ok(PyCSimple {
221+
PyCSimple {
222222
_type_,
223223
value: AtomicCell::new(value),
224224
}
225-
.to_pyobject(vm))
225+
.into_ref_with_type(vm, cls)
226+
.map(Into::into)
226227
}
227228
}
228229

crates/vm/src/stdlib/ctypes/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use libffi::middle::{Arg, Cif, CodePtr, Type};
1313
use libloading::Symbol;
1414
use num_traits::ToPrimitive;
1515
use rustpython_common::lock::PyRwLock;
16-
use std::ffi::{self, CString, c_void};
16+
use std::ffi::{self, c_void};
1717
use std::fmt::Debug;
1818

1919
// See also: https://github.com/python/cpython/blob/4f8bb3947cfbc20f970ff9d9531e1132a9e95396/Modules/_ctypes/callproc.c#L15

0 commit comments

Comments
 (0)