diff -r 8ca6aeabd9fd Python/pystate.c --- a/Python/pystate.c Sun Aug 19 12:33:20 2012 +0200 +++ b/Python/pystate.c Sun Aug 19 14:41:39 2012 +0200 @@ -248,7 +248,7 @@ return NULL; if (state->modules_by_index == NULL) return NULL; - if (index> PyList_GET_SIZE(state->modules_by_index)) + if (index>= PyList_GET_SIZE(state->modules_by_index)) return NULL; res = PyList_GET_ITEM(state->modules_by_index, index); return res==Py_None ? NULL : res;