[Zope-Checkins] CVS: Zope3/lib/python/Zope/ContextWrapper - wrapper.c:1.12.2.8

Jim Fulton jim@zope.com
Fri, 1 Feb 2002 19:24:31 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/ContextWrapper
In directory cvs.zope.org:/tmp/cvs-serv1496

Modified Files:
      Tag: Zope-3x-branch
	wrapper.c 
Log Message:
Changed getattr to always delegate to the wrapped object. 
I'm not sure what it was doing before, but when we asked for
__call__, we got the __call__ of the wrapper, not the __call__
of the wrapped object. This made introspection impossible.


=== Zope3/lib/python/Zope/ContextWrapper/wrapper.c 1.12.2.7 => 1.12.2.8 ===
 {
     PyObject *result;
+    /*
     char *s = PyString_AS_STRING(name);
     if (s[0] == '_' && strcmp(s, "__class__") == 0) {
         result = (PyObject *)(Wrapper_GetObject(self)->ob_type);
@@ -124,7 +125,10 @@
             result = PyObject_GetAttr(Wrapper_GetObject(self), name);
         }
     }
-    return result;
+    */
+
+  result = PyObject_GetAttr(Wrapper_GetObject(self), name);
+  return result;
 }
 
 static int