File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2389,7 +2389,7 @@ def check_argument_count(
23892389 )
23902390
23912391 # Check for too many or few values for formals.
2392- missing_contiguous_pos_block = []
2392+ missing_contiguous_pos_block : list [ int ] = []
23932393 seen_kw = False
23942394 for i , kind in enumerate (callee .arg_kinds ):
23952395 mapped_args = formal_to_actual [i ]
@@ -2445,8 +2445,12 @@ def check_argument_count(
24452445 # missing from the call but doesn't belong to continuous positional prefix,
24462446 # it was already reported as a missing kwarg. All args before first prefix
24472447 # item are guaranteed to have been passed positionally.
2448- passed_or_reported_names = callee .arg_names [missing_contiguous_pos_block [- 1 ] + 1 :]
2449- assert None not in passed_or_reported_names
2448+ passed_or_reported_names = [
2449+ name
2450+ for name in callee .arg_names [missing_contiguous_pos_block [- 1 ] + 1 :]
2451+ # None may be there if it was an optional posonly param
2452+ if name is not None
2453+ ]
24502454 names_to_use = [None ] * missing_contiguous_pos_block [0 ] + passed_or_reported_names
24512455 self .msg .too_few_arguments (callee , context , names_to_use )
24522456 if object_type and callable_name and "." in callable_name :
You can’t perform that action at this time.
0 commit comments