]> granicus.if.org Git - python/commitdiff
The return value from PyObject_ClearWeakRefs() is no longer meaningful,
authorFred Drake <fdrake@acm.org>
Mon, 26 Feb 2001 18:56:37 +0000 (18:56 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 26 Feb 2001 18:56:37 +0000 (18:56 +0000)
so make it void.

Include/object.h
Modules/_weakref.c
Objects/classobject.c
Objects/object.c

index 2f683eb58857175b264efe6669a33cf2cce7e691..80669da7d946c2823d065082b35115366df5c6d3 100644 (file)
@@ -284,7 +284,7 @@ extern DL_IMPORT(int) PyCallable_Check(PyObject *);
 extern DL_IMPORT(int) PyNumber_Coerce(PyObject **, PyObject **);
 extern DL_IMPORT(int) PyNumber_CoerceEx(PyObject **, PyObject **);
 
-extern DL_IMPORT(int) (*PyObject_ClearWeakRefs)(PyObject *);
+extern DL_IMPORT(void) (*PyObject_ClearWeakRefs)(PyObject *);
 
 /* Helpers for printing recursive container types */
 extern DL_IMPORT(int) Py_ReprEnter(PyObject *);
index a856901af9b9325f3fd1c753bcb38f81708d1268..502d568bbafc0ea31ebb92f90e9b2fc00b1dec90 100644 (file)
@@ -692,7 +692,7 @@ weakref_proxy(PyObject *self, PyObject *args)
  * until one resurrects the object, at which point it stops invalidating
  * weak references and returns false.
  */
-static int
+static
 cleanup_helper(PyObject *object)
 {
     PyWeakReference **list;
@@ -702,7 +702,7 @@ cleanup_helper(PyObject *object)
         || object->ob_refcnt != 0) {
         PyErr_BadInternalCall();
         /* not sure what we should return here */
-        return 1;
+        return;
     }
     list = GET_WEAKREFS_LISTPTR(object);
     while (*list != NULL) {
@@ -722,7 +722,7 @@ cleanup_helper(PyObject *object)
             Py_DECREF(callback);
         }
     }
-    return (object->ob_refcnt > 0 ? 0 : 1);
+    return;
 }
 
 
index 9cca19f832a9dd1d89a48e5e8512cda859d7cb69..00cfdde6272572f22bdc66dc7b66962df0abf0c7 100644 (file)
@@ -516,8 +516,7 @@ instance_dealloc(register PyInstanceObject *inst)
        extern long _Py_RefTotal;
 #endif
 
-       if (!PyObject_ClearWeakRefs((PyObject *) inst))
-               return;
+       PyObject_ClearWeakRefs((PyObject *) inst);
 
        /* Temporarily resurrect the object. */
 #ifdef Py_TRACE_REFS
index 8a898f8bbf6b978f456eb33b81c720fbf83c7beb..db7d518a3f0a0722dd4b9558d552632ee0a07877 100644 (file)
@@ -1475,13 +1475,13 @@ PyObject_Free(void *p)
    call site instead of requiring a test for NULL.
 */
 
-static int
+static void
 empty_clear_weak_refs(PyObject *o)
 {
-    return 1;
+    return;
 }
 
-int (*PyObject_ClearWeakRefs)(PyObject *) = empty_clear_weak_refs;
+void (*PyObject_ClearWeakRefs)(PyObject *) = empty_clear_weak_refs;