forked from Rust-related/RustPython
Callable::call -> PyType::call for readability
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user