diff options
author | recht <recht@pkgsrc.org> | 2003-12-08 21:13:56 +0000 |
---|---|---|
committer | recht <recht@pkgsrc.org> | 2003-12-08 21:13:56 +0000 |
commit | d5dc8a4e54a19470f02f1b7f76da73f4000c0776 (patch) | |
tree | 70f4cf85affe88fccec44ff34b037ea0db35eb45 /lang/python23-pth/patches/patch-ak | |
parent | 53ea1a025305bb572a58900ddd2bcd8cb020005d (diff) | |
download | pkgsrc-d5dc8a4e54a19470f02f1b7f76da73f4000c0776.tar.gz |
Update to Python 2.3.2
Changes in Python:
Quite a few fixes.. See NEWS for details.
Changes in the pkg:
- add FreeBSD patches from the FreeBSD port
- add fix for a fatal bug in type's GC handling causes segfaults
(via FreeBSD port)
see http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Misc/NEWS?r1=1.831.4.75&r2=1.831.4.76&diff_format=u
- always build the db 1.85 module (on all platforms)
Diffstat (limited to 'lang/python23-pth/patches/patch-ak')
-rw-r--r-- | lang/python23-pth/patches/patch-ak | 74 |
1 files changed, 65 insertions, 9 deletions
diff --git a/lang/python23-pth/patches/patch-ak b/lang/python23-pth/patches/patch-ak index af3c5caeced..f1bbd32e9fc 100644 --- a/lang/python23-pth/patches/patch-ak +++ b/lang/python23-pth/patches/patch-ak @@ -1,12 +1,68 @@ -$NetBSD: patch-ak,v 1.1 2003/08/06 11:38:11 drochner Exp $ +$NetBSD: patch-ak,v 1.2 2003/12/08 21:13:56 recht Exp $ ---- Python/thread.c.orig 2003-04-19 17:41:53.000000000 +0200 -+++ Python/thread.c 2003-07-30 20:27:45.000000000 +0200 -@@ -98,6 +98,7 @@ +--- Objects/weakrefobject.c.orig 2003-07-14 23:46:23.000000000 +0200 ++++ Objects/weakrefobject.c +@@ -53,17 +53,43 @@ clear_weakref(PyWeakReference *self) + if (*list == self) + *list = self->wr_next; + self->wr_object = Py_None; +- self->wr_callback = NULL; + if (self->wr_prev != NULL) + self->wr_prev->wr_next = self->wr_next; + if (self->wr_next != NULL) + self->wr_next->wr_prev = self->wr_prev; + self->wr_prev = NULL; + self->wr_next = NULL; +- Py_XDECREF(callback); ++ } ++ if (callback != NULL) { ++ Py_DECREF(callback); ++ self->wr_callback = NULL; + } + } - #ifdef HAVE_PTH - #include "thread_pth.h" -+#undef _POSIX_THREADS - #endif ++/* Cyclic gc uses this to *just* clear the passed-in reference, leaving ++ * the callback intact and uncalled. It must be possible to call self's ++ * tp_dealloc() after calling this, so self has to be left in a sane enough ++ * state for that to work. We expect tp_dealloc to decref the callback ++ * then. The reason for not letting clear_weakref() decref the callback ++ * right now is that if the callback goes away, that may in turn trigger ++ * another callback (if a weak reference to the callback exists) -- running ++ * arbitrary Python code in the middle of gc is a disaster. The convolution ++ * here allows gc to delay triggering such callbacks until the world is in ++ * a sane state again. ++ */ ++void ++_PyWeakref_ClearRef(PyWeakReference *self) ++{ ++ PyObject *callback; ++ ++ assert(self != NULL); ++ assert(PyWeakref_Check(self)); ++ /* Preserve and restore the callback around clear_weakref. */ ++ callback = self->wr_callback; ++ self->wr_callback = NULL; ++ clear_weakref(self); ++ self->wr_callback = callback; ++} - #ifdef _POSIX_THREADS + static void + weakref_dealloc(PyWeakReference *self) +@@ -117,7 +143,7 @@ weakref_hash(PyWeakReference *self) + self->hash = PyObject_Hash(PyWeakref_GET_OBJECT(self)); + return self->hash; + } +- ++ + + static PyObject * + weakref_repr(PyWeakReference *self) +@@ -324,7 +350,7 @@ WRAP_BINARY(proxy_iand, PyNumber_InPlace + WRAP_BINARY(proxy_ixor, PyNumber_InPlaceXor) + WRAP_BINARY(proxy_ior, PyNumber_InPlaceOr) + +-static int ++static int + proxy_nonzero(PyWeakReference *proxy) + { + PyObject *o = PyWeakref_GET_OBJECT(proxy); |