Use isinstance(foo, basestring) so that it can work with unicode strings too.
authorZac Medico <zmedico@gentoo.org>
Thu, 11 Jan 2007 17:34:56 +0000 (17:34 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 11 Jan 2007 17:34:56 +0000 (17:34 -0000)
svn path=/main/trunk/; revision=5553

pym/portage_exception.py

index 8791b2fd5fa81bbae02410e445da1de0b4cfe707..76f2be20aaf934f74ec429c9f3d512b2d1ecac74 100644 (file)
@@ -8,7 +8,7 @@ class PortageException(Exception):
        def __init__(self,value):
                self.value = value[:]
        def __str__(self):
-               if isinstance(self.value, str):
+               if isinstance(self.value, basestring):
                        return self.value
                else:
                        return repr(self.value)