[ZODB-Dev] ZODB3-3.1b1

Jeremy Hylton jeremy@alum.mit.edu
Tue, 17 Sep 2002 11:54:13 -0400


>>>>> "GvR" == Guido van Rossum <guido@python.org> writes:

  >> The only solution for people on affected platforms is to get a
  >> Python 2.2.2 release out.

  GvR> Or we could provide a patch for Python 2.2.1?  It looks like
  GvR> it's a two-liner.

Fair enough.  Here is a patch against 2.2.1 that should fix the
crashes.

Jeremy


===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.126.4.19
retrieving revision 2.126.4.20
diff -c -r2.126.4.19 -r2.126.4.20
*** Objects/typeobject.c	2002/07/11 07:06:44	2.126.4.19
--- Objects/typeobject.c	2002/07/16 19:42:21	2.126.4.20
***************
*** 190,196 ****
  		     (PyDict_Check(kwds) && PyDict_Size(kwds) == 0)))
  			return obj;
  		type = obj->ob_type;
! 		if (type->tp_init != NULL &&
  		    type->tp_init(obj, args, kwds) < 0) {
  			Py_DECREF(obj);
  			obj = NULL;
--- 190,197 ----
  		     (PyDict_Check(kwds) && PyDict_Size(kwds) == 0)))
  			return obj;
  		type = obj->ob_type;
! 		if (PyType_HasFeature(type, Py_TPFLAGS_HAVE_CLASS) &&
! 		    type->tp_init != NULL &&
  		    type->tp_init(obj, args, kwds) < 0) {
  			Py_DECREF(obj);
  			obj = NULL;