]> granicus.if.org Git - python/commitdiff
DOMException._get_code():
authorFred Drake <fdrake@acm.org>
Mon, 19 Feb 2001 14:57:02 +0000 (14:57 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 19 Feb 2001 14:57:02 +0000 (14:57 +0000)
    New method; this is the "alternate" access to the exception code.
    (Useful for Python DOM implementations that support the accessor
    method approach to retrieving attribute values.)

Lib/xml/dom/__init__.py

index 5eb15aedc475617a12a7da9e033c54b21a709767..2dbb69502c0f906e8e8592fd74319b47cc0b52a3 100644 (file)
@@ -67,6 +67,9 @@ class DOMException(Exception):
                 "DOMException should not be instantiated directly")
         apply(Exception.__init__, (self,) + args, kw)
 
+    def _get_code(self):
+        return self.code
+
 
 class IndexSizeErr(DOMException):
     code = INDEX_SIZE_ERR