Skip to content

Commit f740845

Browse files
committed
Use vm.class
1 parent bb30d0f commit f740845

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

vm/src/stdlib/thread.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ fn get_ident(_vm: &VirtualMachine) -> u32 {
3636
}
3737

3838
fn allocate_lock(vm: &VirtualMachine) -> PyResult {
39-
let module = vm.import("_thread", &vm.ctx.new_tuple(vec![]), 0)?;
40-
let lock_class = vm.get_attribute(module.clone(), "RLock")?;
41-
vm.invoke(lock_class, vec![])
39+
let lock_class = vm.class("_thread", "RLock");
40+
vm.invoke(lock_class.into_object(), vec![])
4241
}
4342

4443
pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {

0 commit comments

Comments
 (0)