From: Jeremy Hylton Date: Tue, 23 Apr 2002 20:01:20 +0000 (+0000) Subject: Clarify return value of PyLong_AsLongLong(). X-Git-Tag: v2.3c1~5817 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4ad0bcbe5891f0e0df297b28d211696aad5d1ba;p=python 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. --- diff --git a/Objects/longobject.c b/Objects/longobject.c index f11c016294..cbc9f68ca5 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -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; }