[issue4536] SystemError if invalid arguments passed to range() and step=-1

Laszlo report at bugs.python.org
Fri Dec 5 15:54:41 CET 2008


Laszlo <laszlok2 at gmail.com> added the comment:

It is changed from PyErr_Clear() to Py_CLEAR(step) because in case
someone else makes the same mistake of not checking for an error before
calling validate_step() we do not want to hide the error.

It is true that if used properly this part will not get executed, but if
there is another similar programming error like the patch fixes in
range_new() it will at least let the programmer see the right traceback
in the terminal.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4536>
_______________________________________


More information about the Python-bugs-list mailing list