Commits

Oben Sonne committed 49ec4a5

Use more sane __getattr__ instead of __getattribute__ in Page class

Comments (0)

Files changed (1)

 
         self.html = ""
 
-    def __getattribute__(self, name):
-
+    def __getattr__(self, name):
+        """Attribute-style access to dictionary items."""
         try:
-            return super(Page, self).__getattribute__(name)
-        except AttributeError, e:
-            if name in self:
-                return self[name]
-            raise e
+            return self[name]
+        except KeyError:
+            raise AttributeError(name)
 
 # -----------------------------------------------------------------------------