diff options
author | Barry Warsaw <barry@python.org> | 1996-12-18 19:32:18 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1996-12-18 19:32:18 (GMT) |
commit | f90eddef5d3554136623aa81a91187640bf0e92c (patch) | |
tree | 6fb9e05ca10c4f08e6f640f7c2a5bf8126ad1d58 /Objects | |
parent | 2e6313930eab9dbadf6ffb5afed341a809f2c5c5 (diff) | |
download | cpython-f90eddef5d3554136623aa81a91187640bf0e92c.zip cpython-f90eddef5d3554136623aa81a91187640bf0e92c.tar.gz cpython-f90eddef5d3554136623aa81a91187640bf0e92c.tar.bz2 |
PySequence_Index(): set exception when object is not found in
sequence, otherwise
operator.indexOf([4, 3, 2, 1], 9) would raise a SystemError!
Note: it might be wise to double check all these functions. I haven't
done that yet.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index a8823eb..cac767f 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -912,6 +912,7 @@ PySequence_Index(s, o) if(err) return -1; if(! not_equal) return i; } + PyErr_SetString(PyExc_ValueError, "list.index(x): x not in list"); return -1; } |