You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dead code in PyNumber_AsSsize_t() at L1542 #112634
/* We're done if PyLong_AsSsize_t() returns without error. */
result=PyLong_AsSsize_t(value);
if (result!=-1)
goto finish;
PyThreadState*tstate=_PyThreadState_GET();
runerr=_PyErr_Occurred(tstate);
if (!runerr) {
goto finish;
}
/* Error handling code -- only manage OverflowError differently */
if (!PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
But according to the docs (https://docs.python.org/3/c-api/long.html?#c.PyLong_AsSsize_t), PyLong_AsSsize_t() call above may raise only OverflowError (at that line "value" - is an int or int subclass). I think we can turn this line to an assert (or just remove it entirely).
Activity
pythongh-112634: remove dead code in PyNumber_AsSsize_t()
[-]Dead code in PyNumber_AsSsize_t()[/-][+]Dead code in PyNumber_AsSsize_t() at L1542[/+]