diff --git a/vm/src/builtins/bytearray.rs b/vm/src/builtins/bytearray.rs index 2eeb780bbf..2a65036ab2 100644 --- a/vm/src/builtins/bytearray.rs +++ b/vm/src/builtins/bytearray.rs @@ -12,6 +12,7 @@ use crate::common::{ }; use crate::{ anystr::{self, AnyStr}, + builtins::PyType, bytesinner::{ bytes_decode, bytes_from_object, value_from_object, ByteInnerFindOptions, ByteInnerNewOptions, ByteInnerPaddingOptions, ByteInnerSplitOptions, @@ -393,7 +394,7 @@ impl PyByteArray { fn fromhex(cls: PyTypeRef, string: PyStrRef, vm: &VirtualMachine) -> PyResult { let bytes = PyBytesInner::fromhex(string.as_str(), vm)?; let bytes = vm.ctx.new_bytes(bytes); - Callable::call(&cls, vec![bytes.into()].into(), vm) + PyType::call(&cls, vec![bytes.into()].into(), vm) } #[pymethod] diff --git a/vm/src/builtins/bytes.rs b/vm/src/builtins/bytes.rs index 921a6baebd..53aa561ef3 100644 --- a/vm/src/builtins/bytes.rs +++ b/vm/src/builtins/bytes.rs @@ -1,6 +1,7 @@ use super::{PositionIterInternal, PyDictRef, PyIntRef, PyStrRef, PyTuple, PyTupleRef, PyTypeRef}; use crate::{ anystr::{self, AnyStr}, + builtins::PyType, bytesinner::{ bytes_decode, ByteInnerFindOptions, ByteInnerNewOptions, ByteInnerPaddingOptions, ByteInnerSplitOptions, ByteInnerTranslateOptions, DecodeArgs, PyBytesInner, @@ -245,7 +246,7 @@ impl PyBytes { fn fromhex(cls: PyTypeRef, string: PyStrRef, vm: &VirtualMachine) -> PyResult { let bytes = PyBytesInner::fromhex(string.as_str(), vm)?; let bytes = vm.ctx.new_bytes(bytes).into(); - Callable::call(&cls, vec![bytes].into(), vm) + PyType::call(&cls, vec![bytes].into(), vm) } #[pymethod]