Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Auto-format: cargo fmt --all
  • Loading branch information
github-actions[bot] committed Feb 3, 2026
commit 9e7faba7f3e3e4c86815c8a3f40b191e39d4920a
2 changes: 1 addition & 1 deletion crates/vm/src/protocol/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ impl PyObject {

if let Some(class_getitem) =
vm.get_attribute_opt(self.to_owned(), identifier!(vm, __class_getitem__))?
&& !vm.is_none(&class_getitem)
&& !vm.is_none(&class_getitem)
{
return class_getitem.call((needle,), vm);
}
Expand Down
5 changes: 1 addition & 4 deletions crates/vm/src/stdlib/ast/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,7 @@ pub(crate) mod _ast {
let is_list_field = if field_name == "args" {
class_name == "Call" || class_name == "arguments"
} else if field_name == "body" || field_name == "orelse" {
!matches!(
class_name.as_str(),
"Lambda" | "Expression" | "IfExp"
)
!matches!(class_name.as_str(), "Lambda" | "Expression" | "IfExp")
} else {
LIST_FIELDS.contains(&field_name)
};
Expand Down
16 changes: 7 additions & 9 deletions crates/vm/src/stdlib/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,13 @@ mod builtins {

// compile(ast_node, ..., PyCF_ONLY_AST) returns the AST after validation
if is_ast_only {
let (expected_type, expected_name) = ast::mode_type_and_name(
&vm.ctx, mode_str,
)
.ok_or_else(|| {
vm.new_value_error(
"compile() mode must be 'exec', 'eval', 'single' or 'func_type'"
.to_owned(),
)
})?;
let (expected_type, expected_name) = ast::mode_type_and_name(&vm.ctx, mode_str)
.ok_or_else(|| {
vm.new_value_error(
"compile() mode must be 'exec', 'eval', 'single' or 'func_type'"
.to_owned(),
)
})?;
if !args.source.fast_isinstance(&expected_type) {
return Err(vm.new_type_error(format!(
"expected {} node, got {}",
Expand Down
Loading