diff options
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index d3a732a62e..86ee6cfc23 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1881,6 +1881,8 @@ loop_subscript(v, w) } i = getintvalue(w); n = (*sq->sq_length)(v); + if (n < 0) + return NULL; /* Exception */ if (i >= n) return NULL; /* End of loop */ return (*sq->sq_item)(v, i); |