[Zodb-checkins] CVS: ZODB3/ExtensionClass/src - Acquisition.c:1.61.20.1 Xaq.py:NONE ThreadLock.c:NONE Record.c:NONE MultiMapping.c:NONE Missing.c:NONE MethodObject.c:NONE ExtensionClass.h:NONE ComputedAttribute.c:NONE Acquisition.h:NONE

Jeremy Hylton jeremy at zope.com
Tue Dec 23 14:06:48 EST 2003


Update of /cvs-repository/ZODB3/ExtensionClass/src
In directory cvs.zope.org:/tmp/cvs-serv26665/ExtensionClass/src

Modified Files:
      Tag: ZODB3-mvcc-2-branch
	Acquisition.c 
Removed Files:
      Tag: ZODB3-mvcc-2-branch
	Xaq.py ThreadLock.c Record.c MultiMapping.c Missing.c 
	MethodObject.c ExtensionClass.h ComputedAttribute.c 
	Acquisition.h 
Log Message:
Merge the head to the mvcc branch.

This merge should be the final preparation for merging the branch to
the trunk.


=== ZODB3/ExtensionClass/src/Acquisition.c 1.61 => 1.61.20.1 ===
--- ZODB3/ExtensionClass/src/Acquisition.c:1.61	Tue Jun 10 11:28:46 2003
+++ ZODB3/ExtensionClass/src/Acquisition.c	Tue Dec 23 14:06:15 2003
@@ -1034,6 +1034,7 @@
 {
   PyObject *name, *filter=0, *extra=Py_None;
   PyObject *expl=0, *defalt=0;
+  PyObject *result;
   int explicit=1;
   int containment=0;
 
@@ -1047,10 +1048,23 @@
 
   if (filter==Py_None) filter=0;
 
-  return Wrapper_findattr(self,name,filter,extra,OBJECT(self),1,
+  result=Wrapper_findattr(self,name,filter,extra,OBJECT(self),1,
 			  explicit || 
 			  self->ob_type==(PyTypeObject*)&Wrappertype,
 			  explicit, containment);
+  if (result == NULL && defalt != NULL) {
+    /* contrary to "Python/bltinmodule.c:builtin_getattr" turn
+       only 'AttributeError' into a default value, such
+       that e.g. "ConflictError" and errors raised by the filter
+       are not mapped to the default value.
+    */
+    if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+      PyErr_Clear();
+      Py_INCREF(defalt);
+      result = defalt;
+    }
+  }
+  return result;
 }
 
 static PyObject *

=== Removed File ZODB3/ExtensionClass/src/Xaq.py ===

=== Removed File ZODB3/ExtensionClass/src/ThreadLock.c ===

=== Removed File ZODB3/ExtensionClass/src/Record.c ===

=== Removed File ZODB3/ExtensionClass/src/MultiMapping.c ===

=== Removed File ZODB3/ExtensionClass/src/Missing.c ===

=== Removed File ZODB3/ExtensionClass/src/MethodObject.c ===

=== Removed File ZODB3/ExtensionClass/src/ExtensionClass.h ===

=== Removed File ZODB3/ExtensionClass/src/ComputedAttribute.c ===

=== Removed File ZODB3/ExtensionClass/src/Acquisition.h ===




More information about the Zodb-checkins mailing list