mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
vm.class() only for non-static types
This commit is contained in:
1 parent
ecf1120bee
commit
3b78c6068b
2 files changed
+5
-4
No files matched your search
+2
-2
@@ -636,7 +636,7 @@ mod _os {
|
||||
#[pyimpl(with(PyStructSequence))]
|
||||
impl StatResult {
|
||||
pub(super) fn into_obj(self, vm: &VirtualMachine) -> PyObjectRef {
|
||||
self.into_struct_sequence(vm, vm.class(super::MODULE_NAME, "stat_result"))
|
||||
self.into_struct_sequence(vm, StatResult::static_type().clone())
|
||||
.unwrap()
|
||||
.into_object()
|
||||
}
|
||||
@@ -1745,7 +1745,7 @@ mod posix {
|
||||
#[pyimpl(with(PyStructSequence))]
|
||||
impl UnameResult {
|
||||
fn into_obj(self, vm: &VirtualMachine) -> PyObjectRef {
|
||||
self.into_struct_sequence(vm, vm.class(super::MODULE_NAME, "uname_result"))
|
||||
self.into_struct_sequence(vm, UnameResult::static_type().clone())
|
||||
.unwrap()
|
||||
.into_object()
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ use crate::builtins::pytype::PyTypeRef;
|
||||
use crate::builtins::tuple::PyTupleRef;
|
||||
use crate::function::OptionalArg;
|
||||
use crate::pyobject::{
|
||||
BorrowValue, Either, PyClassImpl, PyObjectRef, PyResult, PyStructSequence, TryFromObject,
|
||||
BorrowValue, Either, PyClassImpl, PyObjectRef, PyResult, PyStructSequence, StaticType,
|
||||
TryFromObject,
|
||||
};
|
||||
use crate::vm::VirtualMachine;
|
||||
|
||||
@@ -218,7 +219,7 @@ impl PyStructTime {
|
||||
}
|
||||
|
||||
fn into_obj(self, vm: &VirtualMachine) -> PyObjectRef {
|
||||
self.into_struct_sequence(vm, vm.class("time", "struct_time"))
|
||||
self.into_struct_sequence(vm, PyStructTime::static_type().clone())
|
||||
.unwrap()
|
||||
.into_object()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user