Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 181835d

Browse files
authored
Fix compiler warnings about end_col_offset and end_lineno (GH-11735)
1 parent 5033e31 commit 181835d

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

Python/ast.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3871,11 +3871,8 @@ static void
38713871
get_last_end_pos(asdl_seq *s, int *end_lineno, int *end_col_offset)
38723872
{
38733873
int tot = asdl_seq_LEN(s);
3874-
// Suite should not be empty, but it is safe to just ignore it
3875-
// if it will ever occur.
3876-
if (!tot) {
3877-
return;
3878-
}
3874+
// There must be no empty suites.
3875+
assert(tot > 0);
38793876
stmt_ty last = asdl_seq_GET(s, tot - 1);
38803877
*end_lineno = last->end_lineno;
38813878
*end_col_offset = last->end_col_offset;

0 commit comments

Comments
 (0)