Ka-Ping Yee <ping@lfw.org>:
Changes to error messages to increase consistency & clarity.
This (mostly) closes SourceForge patch #101839.
diff --git a/Objects/longobject.c b/Objects/longobject.c
index bfb431f..615d1d8 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -173,7 +173,7 @@
overflow:
PyErr_SetString(PyExc_OverflowError,
- "long int too long to convert");
+ "long int too large to convert");
return -1;
}
@@ -204,7 +204,7 @@
x = (x << SHIFT) + v->ob_digit[i];
if ((x >> SHIFT) != prev) {
PyErr_SetString(PyExc_OverflowError,
- "long int too long to convert");
+ "long int too large to convert");
return (unsigned long) -1;
}
}
@@ -653,7 +653,7 @@
if ((base != 0 && base < 2) || base > 36) {
PyErr_SetString(PyExc_ValueError,
- "invalid base for long literal");
+ "long() arg 2 must be >= 2 and <= 36");
return NULL;
}
while (*str != '\0' && isspace(Py_CHARMASK(*str)))
@@ -751,7 +751,7 @@
if (size_b == 0) {
PyErr_SetString(PyExc_ZeroDivisionError,
- "long division or modulo");
+ "long division or modulo by zero");
return -1;
}
if (size_a < size_b ||