]> granicus.if.org Git - python/commitdiff
PyObject_ClearWeakRefs() is now a real function instead of a function pointer;
authorFred Drake <fdrake@acm.org>
Fri, 5 Oct 2001 21:58:11 +0000 (21:58 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 5 Oct 2001 21:58:11 +0000 (21:58 +0000)
the implementation is in Objects/weakrefobject.c.

Include/object.h
Objects/object.c

index 400e65751657b0a2225bc87a3452b26a4a69aa12..e9eeb0eaec8f6a64f92199c89bed91f07611adfd 100644 (file)
@@ -345,7 +345,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(void) (*PyObject_ClearWeakRefs)(PyObject *);
+extern DL_IMPORT(void) PyObject_ClearWeakRefs(PyObject *);
 
 /* A slot function whose address we need to compare */
 extern int _PyObject_SlotCompare(PyObject *, PyObject *);
index 88fa34059c82d01ee716a8ddff2c2c308fc6ceaa..a0082456ce9bafba8341c3ba90f33e823ea75e09 100644 (file)
@@ -1841,21 +1841,6 @@ PyObject_Free(void *p)
 }
 
 
-/* Hook to clear up weak references only once the _weakref module is
-   imported.  We use a dummy implementation to simplify the code at each
-   call site instead of requiring a test for NULL.
-*/
-
-static void
-empty_clear_weak_refs(PyObject *o)
-{
-    return;
-}
-
-void (*PyObject_ClearWeakRefs)(PyObject *) = empty_clear_weak_refs;
-
-
-
 /* These methods are used to control infinite recursion in repr, str, print,
    etc.  Container objects that may recursively contain themselves,
    e.g. builtin dictionaries and lists, should used Py_ReprEnter() and