@@ -1007,9 +1007,12 @@ def unexpected_keyword_argument(
10071007 matching_type_args .append (callee_arg_name )
10081008 else :
10091009 not_matching_type_args .append (callee_arg_name )
1010- matches = best_matches (name , matching_type_args , n = 3 )
1011- if not matches :
1012- matches = best_matches (name , not_matching_type_args , n = 3 )
1010+ if not self .prefer_simple_messages ():
1011+ matches = best_matches (name , matching_type_args , n = 3 )
1012+ if not matches :
1013+ matches = best_matches (name , not_matching_type_args , n = 3 )
1014+ else :
1015+ matches = []
10131016 self .unexpected_keyword_argument_for_function (
10141017 for_function (callee ), name , context , matches = matches
10151018 )
@@ -1128,9 +1131,12 @@ def no_variant_matches_arguments(
11281131 if item_has_type_match :
11291132 has_matching_variant = True
11301133
1131- matches = best_matches (kwarg_name , matching_type_args , n = 3 )
1132- if not matches :
1133- matches = best_matches (kwarg_name , not_matching_type_args , n = 3 )
1134+ if not self .prefer_simple_messages ():
1135+ matches = best_matches (kwarg_name , matching_type_args , n = 3 )
1136+ if not matches :
1137+ matches = best_matches (kwarg_name , not_matching_type_args , n = 3 )
1138+ else :
1139+ matches = []
11341140
11351141 if matches :
11361142 kwargs_with_suggestions .append ((kwarg_name , matches ))
0 commit comments