summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorIvan Levkivskyi <levkivskyi@gmail.com>2019-02-10 15:39:49 (GMT)
committerGitHub <noreply@github.com>2019-02-10 15:39:49 (GMT)
commit181835d5a9bffee247bc2f7eefc778c1812bc982 (patch)
tree32c24b5024d8f068a89df809627b353f07d6ec57 /Python/ast.c
parent5033e315d28d54a41bcd987d04e6e6453d5b275f (diff)
downloadcpython-181835d5a9bffee247bc2f7eefc778c1812bc982.zip
cpython-181835d5a9bffee247bc2f7eefc778c1812bc982.tar.gz
cpython-181835d5a9bffee247bc2f7eefc778c1812bc982.tar.bz2
Fix compiler warnings about end_col_offset and end_lineno (GH-11735)
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 45578a8..4fa98b1 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -3871,11 +3871,8 @@ static void
get_last_end_pos(asdl_seq *s, int *end_lineno, int *end_col_offset)
{
int tot = asdl_seq_LEN(s);
- // Suite should not be empty, but it is safe to just ignore it
- // if it will ever occur.
- if (!tot) {
- return;
- }
+ // There must be no empty suites.
+ assert(tot > 0);
stmt_ty last = asdl_seq_GET(s, tot - 1);
*end_lineno = last->end_lineno;
*end_col_offset = last->end_col_offset;