[Checkins] SVN: five.pt/trunk/ Fixed issue with the ``UnauthorizedBinding`` and traversal.

Malthe Borch mborch at gmail.com
Fri Jul 22 18:07:42 EDT 2011


Log message for revision 122320:
  Fixed issue with the ``UnauthorizedBinding`` and traversal.

Changed:
  U   five.pt/trunk/CHANGES.txt
  U   five.pt/trunk/src/five/pt/expressions.py

-=-
Modified: five.pt/trunk/CHANGES.txt
===================================================================
--- five.pt/trunk/CHANGES.txt	2011-07-22 15:23:20 UTC (rev 122319)
+++ five.pt/trunk/CHANGES.txt	2011-07-22 22:07:41 UTC (rev 122320)
@@ -1,6 +1,12 @@
 Changelog
 =========
 
+In next release ...
+
+- Fixed compatibility issue with the ``UnauthorizedBinding`` class and
+  traversal.
+  [malthe]
+
 2.1.2 (2011-07-21)
 ~~~~~~~~~~~~~~~~~~
 

Modified: five.pt/trunk/src/five/pt/expressions.py
===================================================================
--- five.pt/trunk/src/five/pt/expressions.py	2011-07-22 15:23:20 UTC (rev 122319)
+++ five.pt/trunk/src/five/pt/expressions.py	2011-07-22 22:07:41 UTC (rev 122320)
@@ -97,20 +97,16 @@
             while i < length:
                 name = path_items[i]
                 i += 1
-                next = getattr(base, name, _marker)
-                if next is not _marker:
-                    base = next
-                    continue
+
+                # special-case dicts for performance reasons
+                if isinstance(base, dict):
+                    base = base[name]
+                elif ITraversable.providedBy(base):
+                    traverser = getattr(base, method)
+                    base = traverser(name)
                 else:
-                    # special-case dicts for performance reasons
-                    if isinstance(base, dict):
-                        base = base[name]
-                    elif ITraversable.providedBy(base):
-                        traverser = getattr(base, method)
-                        base = traverser(name)
-                    else:
-                        base = traversePathElement(
-                            base, name, path_items[i:], request=request)
+                    base = traversePathElement(
+                        base, name, path_items[i:], request=request)
 
         if call is False:
             return base



More information about the checkins mailing list