Callable::call -> PyType::call for readability

This commit is contained in:
Jeong YunWon
2021-10-05 07:44:28 +09:00
parent c086e17bc6
commit 2acacec967
2 changed files with 4 additions and 2 deletions

View File

@@ -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]

View File

@@ -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]