diff Objects/longobject.c @ 23248:97650edf58bb legacy-trunk

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.
author Jeremy Hylton <jeremy@alum.mit.edu>
date Tue, 23 Apr 2002 20:01:20 +0000
parents 72778ec94dec
children ed1ba37a46b7
line wrap: on
line diff
--- a/Objects/longobject.c	Tue Apr 23 19:59:03 2002 +0000
+++ b/Objects/longobject.c	Tue Apr 23 20:01:20 2002 +0000
@@ -696,7 +696,7 @@
 
 	/* Plan 9 can't handle LONG_LONG in ? : expressions */
 	if (res < 0)
-		return (LONG_LONG)res;
+		return (LONG_LONG)-1;
 	else
 		return bytes;
 }