commit | d6fc2623c5e765df20f2072aa6575b0c5c272692 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Tue Feb 03 02:23:19 2009 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Tue Feb 03 02:23:19 2009 +0000 |
tree | fed146296b4c1866efd720382e34507c672fd751 | |
parent | b516370bcbeef7391edc28fa6bfcc8da6d98beea [diff] [blame] |
Validate that __length_hint__ returns a usable result.
diff --git a/Objects/abstract.c b/Objects/abstract.c index 1ac4ac9..d601288 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c
@@ -123,7 +123,7 @@ PyErr_Clear(); return defaultvalue; } - rv = PyInt_AsLong(ro); + rv = rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; Py_DECREF(ro); return rv; }