Skip to content

Commit ead1013

Browse files
committed
Remove unused branch in _make_posargs
`names_with_default` is never `NULL`, even if there are no names with defaults. In that case it points to a structure with `size` zero. Rather than eliminating the branch, we leave it behind with an `assert(0)` in case a future change to the grammar exercises the branch.
1 parent 31a4fb3 commit ead1013

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Parser/action_helpers.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,10 @@ _make_posargs(Parser *p,
555555
*posargs = _get_names(p, names_with_default);
556556
}
557557
else if (plain_names != NULL && names_with_default == NULL) {
558-
*posargs = plain_names;
558+
// With the current grammar, we never get here.
559+
// If that has changed, remove the assert, and test thoroughly.
560+
assert(0);
561+
*posargs = plain_names;
559562
}
560563
else {
561564
*posargs = _Py_asdl_arg_seq_new(0, p->arena);

0 commit comments

Comments
 (0)