[entropy.exceptions] make module Python 3.x aware

This commit is contained in:
Fabio Erculiani
2009-10-04 19:01:12 +02:00
parent b51a59533a
commit 9d2b9d8a56
+3 -3
View File
@@ -11,6 +11,7 @@
This module contains Entropy Framework exceptions classes.
"""
from entropy.const import const_isstring
class EntropyException(Exception):
"""General superclass for Entropy exceptions"""
@@ -19,10 +20,9 @@ class EntropyException(Exception):
Exception.__init__(self)
def __str__(self):
if isinstance(self.value, basestring):
if const_isstring(self.value):
return self.value
else:
return repr(self.value)
return repr(self.value)
class CorruptionError(EntropyException):
"""Corruption indication"""