[Zodb-checkins] CVS: Zope/lib/Components/ExtensionClass/src - Missing.c:1.13.10.2

Jeremy Hylton jeremy at zope.com
Fri May 9 17:03:04 EDT 2003


Update of /cvs-repository/Zope/lib/Components/ExtensionClass/src
In directory cvs.zope.org:/tmp/cvs-serv8709

Modified Files:
      Tag: Zope-2_6-branch
	Missing.c 
Log Message:
Backport coercion bug fix.


=== Zope/lib/Components/ExtensionClass/src/Missing.c 1.13.10.1 => 1.13.10.2 ===
--- Zope/lib/Components/ExtensionClass/src/Missing.c:1.13.10.1	Wed Nov 13 11:40:01 2002
+++ Zope/lib/Components/ExtensionClass/src/Missing.c	Fri May  9 16:03:02 2003
@@ -78,12 +78,15 @@
   return 0;
 }
 
+/* XXX Why does this type offer to corece at all? */
 static int
 Missing_coerce(PyObject **pv, PyObject **pw)
 {
-  Py_INCREF(*pv);
-  Py_INCREF(*pw);
-  return 0;
+    if (!(*pw)->ob_type->tp_as_number)
+	return 1;
+    Py_INCREF(*pv);
+    Py_INCREF(*pw);
+    return 0;
 }
 
 static PyObject *
@@ -302,6 +305,9 @@
 Revision Log:
 
   $Log$
+  Revision 1.13.10.2  2003/05/09 20:03:02  jeremy
+  Backport coercion bug fix.
+
   Revision 1.13.10.1  2002/11/13 16:40:01  jeremy
   Backport: Fix includes before Python.h.
 




More information about the Zodb-checkins mailing list