changeset 33:0d172e5766fc

Revert 29:3a9710b7a785: Element - Use standard get behaviour
author Bastian Blank <bblank@thinkmo.de>
date Sun, 13 Jul 2008 20:47:29 +0200
parents 7b5ed8600569
children 296964441d48
files emeraldtree/ElementTree.py
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/emeraldtree/ElementTree.py	Tue Jul 08 15:05:25 2008 +0200
+++ b/emeraldtree/ElementTree.py	Sun Jul 13 20:47:29 2008 +0200
@@ -122,8 +122,6 @@
 
 import ElementPath
 
-_marker = object()
-
 class ParseError(SyntaxError):
     pass
 
@@ -342,11 +340,8 @@
     # @return The attribute value, or the default value, if the
     #     attribute was not found.
 
-    def get(self, key, default=_marker):
-        ret = self.attrib.get(key, default)
-        if ret is default and default is _marker:
-            raise KeyError(key)
-        return ret
+    def get(self, key, default=None):
+        return self.attrib.get(key, default)
 
     ##
     # Sets an element attribute.