]> granicus.if.org Git - python/commitdiff
Replace PyErr_BadArgument() error in PyInt_AsLong() with "an integer
authorGuido van Rossum <guido@python.org>
Tue, 9 May 2000 14:27:48 +0000 (14:27 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 9 May 2000 14:27:48 +0000 (14:27 +0000)
is required" (we can't say more because we don't know in which context
it is called).

Objects/intobject.c

index 79435a990a55c0c1a16e6d8a02e509b389af9991..2e8939e65e308acd68471d34da48e0a1acce3b2d 100644 (file)
@@ -198,7 +198,7 @@ PyInt_AsLong(op)
        
        if (op == NULL || (nb = op->ob_type->tp_as_number) == NULL ||
            nb->nb_int == NULL) {
-               PyErr_BadArgument();
+               PyErr_SetString(PyExc_TypeError, "an integer is required");
                return -1;
        }