mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Merged revisions 72518 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72518 | benjamin.peterson | 2009-05-09 14:18:36 -0500 (Sat, 09 May 2009) | 1 line clear error state properly ........
This commit is contained in:
parent
3131bb107d
commit
e18df23d5d
1 changed files with 1 additions and 0 deletions
|
@ -98,6 +98,7 @@ _PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
|
|||
if (ro == NULL) {
|
||||
if (!PyErr_ExceptionMatches(PyExc_TypeError))
|
||||
return -1;
|
||||
PyErr_Clear();
|
||||
return defaultvalue;
|
||||
}
|
||||
rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue