Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c4ad0bc

Browse files
committed
Clarify return value of PyLong_AsLongLong().
The function is documented to return -1 on error. If res was < 0, it returned res. It wasn't clear that the invariant was res < 0 iff res == -1.
1 parent 656b735 commit c4ad0bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/longobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ PyLong_AsLongLong(PyObject *vv)
696696

697697
/* Plan 9 can't handle LONG_LONG in ? : expressions */
698698
if (res < 0)
699-
return (LONG_LONG)res;
699+
return (LONG_LONG)-1;
700700
else
701701
return bytes;
702702
}

0 commit comments

Comments
 (0)