Fix speed regression in costExcludes (super magic)
authorJames Antill <james@and.org>
Mon, 6 Jul 2009 18:11:58 +0000 (14:11 -0400)
committerJames Antill <james@and.org>
Tue, 7 Jul 2009 05:22:04 +0000 (01:22 -0400)
yum/packages.py

index d4838ee..a124d7b 100644 (file)
@@ -237,6 +237,11 @@ class PackageObject(object):
                                       self.arch)
         return out
 
+    def __unicode__(self):
+        """ This is here because unicode(pkg) is roughly 50x slower than
+            str(pkg), and "%s" % (pkg,) uses unicode(). """
+        return misc.to_unicode(self.__str__())
+
     def verCMP(self, other):
         """ Compare package to another one, only rpm-version ordering. """
         if not other: