[Zope3-checkins] CVS: Zope3/src/zope/proxy/context - wrapper.c:1.9

Jim Fulton jim@zope.com
Thu, 1 May 2003 17:37:58 -0400


Update of /cvs-repository/Zope3/src/zope/proxy/context
In directory cvs.zope.org:/tmp/cvs-serv17349/zope/proxy/context

Modified Files:
	wrapper.c 
Log Message:
Fixed a bug in getting the __class__ attribute from wrappers around
context-aware objects.  We were returning the class of the wrapper
rather than the class of the wrapped objects.


=== Zope3/src/zope/proxy/context/wrapper.c 1.8 => 1.9 ===
--- Zope3/src/zope/proxy/context/wrapper.c:1.8	Fri Apr 11 09:23:40 2003
+++ Zope3/src/zope/proxy/context/wrapper.c	Thu May  1 17:37:27 2003
@@ -652,8 +652,11 @@
     if (descriptor != NULL &&
         descriptor->ob_type->tp_descr_get != NULL &&
         (PyObject_TypeCheck(descriptor, &ContextDescriptorType) ||
-         PyObject_TypeCheck(wrapped, &ContextAwareType))
+         PyObject_TypeCheck(wrapped, &ContextAwareType)) &&
+        ! (PyString_Check(name)
+           && strcmp(PyString_AS_STRING(name), "__class__") == 0)
         ) {
+      
         wrapped_type = (PyObject *)wrapped->ob_type;
         if (wrapped_type == NULL)
             return NULL;