]> granicus.if.org Git - python/commitdiff
recursive_isinstance(), recursive_issubclass(): New code here returned
authorTim Peters <tim.peters@gmail.com>
Sun, 21 Mar 2004 16:59:09 +0000 (16:59 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 21 Mar 2004 16:59:09 +0000 (16:59 +0000)
NULL in case of error, but the functions are declared to return int.
MSVC 6 properly complains about that.  Return -1 on error instead.

Objects/abstract.c

index 3d6d82920f2c3a582c2247f06837e4614c001fd9..bf60c750f1b3f6b0c8d60f79a52fa97c4b7294f3 100644 (file)
@@ -2033,7 +2033,7 @@ recursive_isinstance(PyObject *inst, PyObject *cls, int recursion_depth)
                 if (!recursion_depth) {
                     PyErr_SetString(PyExc_RuntimeError,
                                     "nest level of tuple too deep");
-                    return NULL;
+                    return -1;
                 }
 
                n = PyTuple_GET_SIZE(cls);
@@ -2088,7 +2088,7 @@ recursive_issubclass(PyObject *derived, PyObject *cls, int recursion_depth)
                         if (!recursion_depth) {
                             PyErr_SetString(PyExc_RuntimeError,
                                             "nest level of tuple too deep");
-                            return NULL;
+                            return -1;
                         }
                        for (i = 0; i < n; ++i) {
                                retval = recursive_issubclass(