#155: Fix Python 2.4 compatibility: exceptions are old-style classes there.

This commit is contained in:
Georg Brandl 2009-05-10 21:14:14 +02:00
parent 64d2c2c795
commit b1dbe95255
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,9 @@
Release 0.6.2 (in development) Release 0.6.2 (in development)
============================== ==============================
* #155: Fix Python 2.4 compatibility: exceptions are old-style
classes there.
* #150: Fix display of the "sphinxdoc" theme on Internet Explorer * #150: Fix display of the "sphinxdoc" theme on Internet Explorer
versions 6 and 7. versions 6 and 7.

View File

@ -28,7 +28,7 @@ class ExtensionError(SphinxError):
category = 'Extension error' category = 'Extension error'
def __init__(self, message, orig_exc=None): def __init__(self, message, orig_exc=None):
super(ExtensionError, self).__init__(message) SphinxError.__init__(self, message)
self.orig_exc = orig_exc self.orig_exc = orig_exc
def __repr__(self): def __repr__(self):
@ -38,7 +38,7 @@ class ExtensionError(SphinxError):
return '%s(%r)' % (self.__class__.__name__, self.message) return '%s(%r)' % (self.__class__.__name__, self.message)
def __str__(self): def __str__(self):
parent_str = super(ExtensionError, self).__str__() parent_str = SphinxError.__str__(self)
if self.orig_exc: if self.orig_exc:
return '%s (exception: %s)' % (parent_str, self.orig_exc) return '%s (exception: %s)' % (parent_str, self.orig_exc)
return parent_str return parent_str