Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bca1776

Browse files
committed
Simplify code
1 parent b5a60f7 commit bca1776

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vm/src/builtins/type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ pub(crate) fn call_slot_new(
11291129
}
11301130
}
11311131
if let Some(ref basetype) = staticbase {
1132-
if !PyType::subclasscheck(basetype.to_owned(), typ.to_owned()) {
1132+
if !typ.fast_issubclass(basetype) {
11331133
return Err(vm.new_type_error(format!(
11341134
"{}.__new__({}) is not safe, use {}.__new__()",
11351135
typ.name(),

0 commit comments

Comments
 (0)