[Zope3-checkins] CVS: Zope3/src/zope/app/traversing - __init__.py:1.8

Steve Alexander steve@cat-box.net
Tue, 25 Feb 2003 13:02:18 -0500


Update of /cvs-repository/Zope3/src/zope/app/traversing
In directory cvs.zope.org:/tmp/cvs-serv14016/src/zope/app/traversing

Modified Files:
	__init__.py 
Log Message:
Fixed bug where the context and not the container was being searched
for getParent. Unit test to follow soon...


=== Zope3/src/zope/app/traversing/__init__.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/traversing/__init__.py:1.7	Tue Feb 11 14:14:19 2003
+++ Zope3/src/zope/app/traversing/__init__.py	Tue Feb 25 13:02:17 2003
@@ -101,7 +101,7 @@
     if IContainmentRoot.isImplementedBy(obj):
         return None
     if isWrapper(obj):
-        parent = getWrapperContext(obj)
+        parent = getWrapperContainer(obj)
         if parent is not None:
             return parent
     raise TypeError("Not enough context information to get parent", obj)
@@ -109,7 +109,7 @@
 def getParents(obj):
     """Returns a list starting with the given object's parent followed by
     each of its parents.
-    
+
     Raises a TypeError if the context doesn't go all the way down to
     a containment root.
     """
@@ -123,7 +123,7 @@
             if w is None:
                 break
             parents.append(w)
-            
+
         if parents and IContainmentRoot.isImplementedBy(parents[-1]):
             return parents
     raise TypeError, "Not enough context information to get all parents"