[Zope3-checkins] CVS: Zope3/src/zope/interface - _zope_interface_ospec.c:1.5

Jim Fulton jim@zope.com
Wed, 28 May 2003 12:45:00 -0400


Update of /cvs-repository/Zope3/src/zope/interface
In directory cvs.zope.org:/tmp/cvs-serv20774

Modified Files:
	_zope_interface_ospec.c 
Log Message:
Fixed OSpec_init. I though init slots were like __init__ methods and
returned None.  They return ints (<0 means error).

This bug caused references to None to be leaked.


=== Zope3/src/zope/interface/_zope_interface_ospec.c 1.4 => 1.5 ===
--- Zope3/src/zope/interface/_zope_interface_ospec.c:1.4	Wed May 21 14:21:40 2003
+++ Zope3/src/zope/interface/_zope_interface_ospec.c	Wed May 28 12:44:59 2003
@@ -93,7 +93,7 @@
   PyObject *ob;
 } OSpec;
 
-static PyObject *
+static int
 OSpec_init(OSpec *self, PyObject *args, PyObject *kwds)
 {
 	static char *kwlist[] = {"ob", NULL};
@@ -101,13 +101,12 @@
 
         if (! PyArg_ParseTupleAndKeywords(args, kwds, "O", kwlist, 
                                           &ob))
-        	return NULL; 
+        	return 0; 
 
         Py_INCREF(ob);
         self->ob = ob;
 
-    	Py_INCREF(Py_None);
-    	return Py_None;
+        return 0;
 }
 
 static void