summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-02-26 18:56:37 (GMT)
committerFred Drake <fdrake@acm.org>2001-02-26 18:56:37 (GMT)
commitb60654bc15597f4b08fb6d97774d655ae5176ca4 (patch)
treec0ced5ef94b82d6a48e24c80de8f2b7c3cffde7e
parent4f9b13bac8335d4614499673a3349b2c97401f12 (diff)
downloadcpython-b60654bc15597f4b08fb6d97774d655ae5176ca4.zip
cpython-b60654bc15597f4b08fb6d97774d655ae5176ca4.tar.gz
cpython-b60654bc15597f4b08fb6d97774d655ae5176ca4.tar.bz2
The return value from PyObject_ClearWeakRefs() is no longer meaningful,
so make it void.
-rw-r--r--Include/object.h2
-rw-r--r--Modules/_weakref.c6
-rw-r--r--Objects/classobject.c3
-rw-r--r--Objects/object.c6
4 files changed, 8 insertions, 9 deletions
diff --git a/Include/object.h b/Include/object.h
index 2f683eb..80669da 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -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 *);
diff --git a/Modules/_weakref.c b/Modules/_weakref.c
index a856901..502d568 100644
--- a/Modules/_weakref.c
+++ b/Modules/_weakref.c
@@ -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;
}
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 9cca19f..00cfdde 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -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
diff --git a/Objects/object.c b/Objects/object.c
index 8a898f8..db7d518 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -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;