File tree Expand file tree Collapse file tree 3 files changed +9
-14
lines changed
Expand file tree Collapse file tree 3 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -704,7 +704,7 @@ impl PyObject {
704704
705705 if let Some ( class_getitem) =
706706 vm. get_attribute_opt ( self . to_owned ( ) , identifier ! ( vm, __class_getitem__) ) ?
707- && !vm. is_none ( & class_getitem)
707+ && !vm. is_none ( & class_getitem)
708708 {
709709 return class_getitem. call ( ( needle, ) , vm) ;
710710 }
Original file line number Diff line number Diff line change @@ -137,10 +137,7 @@ pub(crate) mod _ast {
137137 let is_list_field = if field_name == "args" {
138138 class_name == "Call" || class_name == "arguments"
139139 } else if field_name == "body" || field_name == "orelse" {
140- !matches ! (
141- class_name. as_str( ) ,
142- "Lambda" | "Expression" | "IfExp"
143- )
140+ !matches ! ( class_name. as_str( ) , "Lambda" | "Expression" | "IfExp" )
144141 } else {
145142 LIST_FIELDS . contains ( & field_name)
146143 } ;
Original file line number Diff line number Diff line change @@ -154,15 +154,13 @@ mod builtins {
154154
155155 // compile(ast_node, ..., PyCF_ONLY_AST) returns the AST after validation
156156 if is_ast_only {
157- let ( expected_type, expected_name) = ast:: mode_type_and_name (
158- & vm. ctx , mode_str,
159- )
160- . ok_or_else ( || {
161- vm. new_value_error (
162- "compile() mode must be 'exec', 'eval', 'single' or 'func_type'"
163- . to_owned ( ) ,
164- )
165- } ) ?;
157+ let ( expected_type, expected_name) = ast:: mode_type_and_name ( & vm. ctx , mode_str)
158+ . ok_or_else ( || {
159+ vm. new_value_error (
160+ "compile() mode must be 'exec', 'eval', 'single' or 'func_type'"
161+ . to_owned ( ) ,
162+ )
163+ } ) ?;
166164 if !args. source . fast_isinstance ( & expected_type) {
167165 return Err ( vm. new_type_error ( format ! (
168166 "expected {} node, got {}" ,
You can’t perform that action at this time.
0 commit comments