[Python-checkins] cpython: Minor consistency fixes for some longobject.c exception messages:

mark.dickinson python-checkins at python.org
Sat Aug 3 13:08:36 CEST 2013


http://hg.python.org/cpython/rev/dab7d6f33b87
changeset:   84983:dab7d6f33b87
user:        Mark Dickinson <dickinsm at gmail.com>
date:        Sat Aug 03 12:08:22 2013 +0100
summary:
  Minor consistency fixes for some longobject.c exception messages:
 - replace 'long int' / 'long' by 'int'
 - fix capitalization of "Python" in PyLong_AsUnsignedLong
 - "is too large" -> "too large", for consistency with other messages.

files:
  Objects/longobject.c |  8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/Objects/longobject.c b/Objects/longobject.c
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -549,7 +549,7 @@
         x = (x << PyLong_SHIFT) | v->ob_digit[i];
         if ((x >> PyLong_SHIFT) != prev) {
             PyErr_SetString(PyExc_OverflowError,
-                            "python int too large to convert "
+                            "Python int too large to convert "
                             "to C unsigned long");
             return (unsigned long) -1;
         }
@@ -1602,7 +1602,7 @@
     */
     if (size_a > PY_SSIZE_T_MAX / PyLong_SHIFT) {
         PyErr_SetString(PyExc_OverflowError,
-                        "long is too large to format");
+                        "int too large to format");
         return -1;
     }
     /* the expression size_a * PyLong_SHIFT is now safe from overflow */
@@ -1785,7 +1785,7 @@
         /* Ensure overflow doesn't occur during computation of sz. */
         if (size_a > (PY_SSIZE_T_MAX - 3) / PyLong_SHIFT) {
             PyErr_SetString(PyExc_OverflowError,
-                            "int is too large to format");
+                            "int too large to format");
             return -1;
         }
         size_a_in_bits = (size_a - 1) * PyLong_SHIFT +
@@ -2658,7 +2658,7 @@
     x = _PyLong_Frexp((PyLongObject *)v, &exponent);
     if ((x == -1.0 && PyErr_Occurred()) || exponent > DBL_MAX_EXP) {
         PyErr_SetString(PyExc_OverflowError,
-                        "long int too large to convert to float");
+                        "int too large to convert to float");
         return -1.0;
     }
     return ldexp(x, (int)exponent);

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list