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

Fred L. Drake, Jr. fdrake@acm.org
Thu, 21 Feb 2002 17:55:39 -0500


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

Modified Files:
      Tag: Zope-3x-branch
	wrapper.c 
Log Message:
Fix getobject() bug: returned None for all non-wrapped objects when the
object passed in should have been returned.  Extended docstring to specify
this behavior.
http://collector.zope.org/Zope3-dev/5


=== Zope3/lib/python/Zope/ContextWrapper/wrapper.c 1.12.2.8 => 1.12.2.9 ===
 "getobject(wrapper) --> object\n"
 "\n"
-"Return the underlying object for wrapper.";
+"Return the underlying object for wrapper, or the passed-in object if\n"
+"it is not a wrapper.";
 
 static PyObject *
 wrapper_getobject(PyObject *unused, PyObject *obj)
@@ -567,7 +568,7 @@
     if (Wrapper_Check(obj))
         result = Wrapper_GetObject(obj);
     else
-        result = Py_None;
+        result = obj;
     Py_INCREF(result);
     return result;
 }