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.
This commit is contained in:
parent
656b735af9
commit
c4ad0bcbe5
|
@ -696,7 +696,7 @@ PyLong_AsLongLong(PyObject *vv)
|
|||
|
||||
/* Plan 9 can't handle LONG_LONG in ? : expressions */
|
||||
if (res < 0)
|
||||
return (LONG_LONG)res;
|
||||
return (LONG_LONG)-1;
|
||||
else
|
||||
return bytes;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue