diff options
author | Fred Drake <fdrake@acm.org> | 2000-10-24 19:57:45 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-10-24 19:57:45 (GMT) |
commit | 661ea26b3d8621ad0acc0ed2f2036ab29355f8ff (patch) | |
tree | fcfe10c4656a3e18911cd3b41b7d8c942d707786 /Objects/intobject.c | |
parent | bd6f4fba1bc66a18cc15d50ffdd33faedff5ac4c (diff) | |
download | cpython-661ea26b3d8621ad0acc0ed2f2036ab29355f8ff.zip cpython-661ea26b3d8621ad0acc0ed2f2036ab29355f8ff.tar.gz cpython-661ea26b3d8621ad0acc0ed2f2036ab29355f8ff.tar.bz2 |
Ka-Ping Yee <ping@lfw.org>:
Changes to error messages to increase consistency & clarity.
This (mostly) closes SourceForge patch #101839.
Diffstat (limited to 'Objects/intobject.c')
-rw-r--r-- | Objects/intobject.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c index c9d1f6a..18acf6b 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -171,7 +171,7 @@ PyInt_FromString(char *s, char **pend, int base) char buffer[256]; /* For errors */ if ((base != 0 && base < 2) || base > 36) { - PyErr_SetString(PyExc_ValueError, "invalid base for int()"); + PyErr_SetString(PyExc_ValueError, "int() base must be >= 2 and <= 36"); return NULL; } @@ -417,7 +417,7 @@ i_divmod(register PyIntObject *x, register PyIntObject *y, if (yi == 0) { PyErr_SetString(PyExc_ZeroDivisionError, - "integer division or modulo"); + "integer division or modulo by zero"); return -1; } if (yi < 0) { @@ -485,17 +485,17 @@ int_pow(PyIntObject *v, PyIntObject *w, PyIntObject *z) if (iw < 0) { if (iv) PyErr_SetString(PyExc_ValueError, - "integer to a negative power"); + "cannot raise integer to a negative power"); else PyErr_SetString(PyExc_ZeroDivisionError, - "0 to a negative power"); + "cannot raise 0 to a negative power"); return NULL; } if ((PyObject *)z != Py_None) { iz = z->ob_ival; if (iz == 0) { PyErr_SetString(PyExc_ValueError, - "pow(x, y, z) with z==0"); + "pow() arg 3 cannot be 0"); return NULL; } } |