From b6a442539284448b052597a0733c7308ed8b1d01 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Mon, 19 Feb 2001 14:57:02 +0000 Subject: [PATCH] DOMException._get_code(): 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/xml/dom/__init__.py b/Lib/xml/dom/__init__.py index 5eb15aedc47..2dbb69502c0 100644 --- a/Lib/xml/dom/__init__.py +++ b/Lib/xml/dom/__init__.py @@ -67,6 +67,9 @@ def __init__(self, *args, **kw): "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