[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/publication/zopepublication.py Marked an odd piece of code. I'm not entirely sure what's going on, the

Gintautas Miliauskas gintas at pov.lt
Wed Jul 7 08:16:27 EDT 2004


Log message for revision 26151:
Marked an odd piece of code.  I'm not entirely sure what's going on, the
logic of the code could be flawed as well.  Could someone take a look at this?



-=-
Modified: Zope3/trunk/src/zope/app/publication/zopepublication.py
===================================================================
--- Zope3/trunk/src/zope/app/publication/zopepublication.py	2004-07-07 12:05:49 UTC (rev 26150)
+++ Zope3/trunk/src/zope/app/publication/zopepublication.py	2004-07-07 12:16:27 UTC (rev 26151)
@@ -280,13 +280,15 @@
                 # have one, because it might be a method. If we don't
                 # have a parent attr but have an im_self or an
                 # __self__, use that:
+
+                # XXX The following block of code is silly.
                 loc = object
                 if hasattr(object, '__parent__'):
-                    loc = object
+                    loc = object # XXX That was done two lines above.
                 else:
                     loc = removeAllProxies(object)
                     loc = getattr(loc, 'im_self', loc)
-                    if loc is loc:
+                    if loc is loc:  # XXX if True:
                         loc = getattr(loc, '__self__', loc)
                     loc = ProxyFactory(loc)
 



More information about the Zope3-Checkins mailing list