[Yum-devel] [PATCH 1/2] if we're passed a deptuple keep from passing it to the exception like that

Seth Vidal skvidal at fedoraproject.org
Fri Aug 28 15:22:30 UTC 2009


do the str() conversion on the tuple. I didn't just do the str(depstring) in the
msg in case the depstring we're passed is [not] unicode and cannot be encoded/decoded
properly.
There's less chance of that if it a dep tuple.
---
 yum/__init__.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/yum/__init__.py b/yum/__init__.py
index 3f75528..b395457 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2398,11 +2398,15 @@ class YumBase(depsolve.Depsolve):
         try:
             pkglist = self.returnPackagesByDep(depstring)
         except Errors.YumBaseError:
+            if type(depstring) not in types.StringTypes:
+                depstring = str(depstring)
             raise Errors.YumBaseError, _('No Package found for %s') % depstring
         
         ps = ListPackageSack(pkglist)
         result = self._bestPackageFromList(ps.returnNewestByNameArch())
         if result is None:
+            if type(depstring) not in types.StringTypes:
+                depstring = str(depstring)
             raise Errors.YumBaseError, _('No Package found for %s') % depstring
         
         return result
-- 
1.6.2.5



More information about the Yum-devel mailing list