[Python-checkins] CVS: python/dist/src/Lib/xml/dom __init__.py,1.3,1.4

Fred L. Drake python-dev@python.org
Wed, 13 Dec 2000 08:35:56 -0800


Update of /cvsroot/python/python/dist/src/Lib/xml/dom
In directory slayer.i.sourceforge.net:/tmp/cvs-serv8586/Lib/xml/dom

Modified Files:
	__init__.py 
Log Message:

Add code to DOMException to ensure it cannot be instantiated directly,
since the API documentation will state specifically that the specializations
must be used by the DOM implementations.


Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xml/dom/__init__.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** __init__.py	2000/12/13 14:21:07	1.3
--- __init__.py	2000/12/13 16:35:53	1.4
***************
*** 39,42 ****
--- 39,43 ----
      NOTATION_NODE               = 12
  
+ 
  #ExceptionCode
  INDEX_SIZE_ERR                 = 1
***************
*** 56,64 ****
  INVALID_ACCESS_ERR             = 15
  
  class DOMException(Exception):
      """Abstract base class for DOM exceptions.
      Exceptions with specific codes are specializations of this class."""
      
!     pass
  
  class IndexSizeErr(DOMException):
--- 57,71 ----
  INVALID_ACCESS_ERR             = 15
  
+ 
  class DOMException(Exception):
      """Abstract base class for DOM exceptions.
      Exceptions with specific codes are specializations of this class."""
      
!     def __init__(self, *args, **kw):
!         if self.__class__ is DOMException:
!             raise RuntimeError(
!                 "DOMException should not be instaniated directly")
!         apply(Exception.__init__, args, kw)
! 
  
  class IndexSizeErr(DOMException):