[yum-commits] Branch 'yum-3_2_X' - yum/comps.py yum/repoMDObject.py

James Antill james at osuosl.org
Fri Dec 19 16:10:10 UTC 2008


 yum/comps.py        |    3 ++-
 yum/repoMDObject.py |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 1771f9085002e304bfdcc8a5d7f03e75b483f45d
Author: James Antill <james at and.org>
Date:   Fri Dec 19 11:06:12 2008 -0500

    Understand unicode strings for comps/repoMD

diff --git a/yum/comps.py b/yum/comps.py
index 6820c64..20ff28f 100755
--- a/yum/comps.py
+++ b/yum/comps.py
@@ -13,6 +13,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # Copyright 2005 Duke University
 
+import types
 import sys
 from constants import *
 try:
@@ -495,7 +496,7 @@ class Comps(object):
         if not srcfile:
             raise CompsException
             
-        if type(srcfile) == type('str'):
+        if type(srcfile) not in types.StringTypes:
             # srcfile is a filename string
             infile = open(srcfile, 'rt')
         else:
diff --git a/yum/repoMDObject.py b/yum/repoMDObject.py
index 76d9834..2025d68 100755
--- a/yum/repoMDObject.py
+++ b/yum/repoMDObject.py
@@ -22,6 +22,7 @@ iterparse = cElementTree.iterparse
 from Errors import RepoMDError
 
 import sys
+import types
 from misc import AutoFileChecksums
 
 def ns_cleanup(qn):
@@ -78,7 +79,7 @@ class RepoMD:
         self.revision  = None
         self.tags      = {'content' : set(), 'distro' : {}}
         
-        if type(srcfile) == type('str'):
+        if type(srcfile) not in types.StringTypes:
             # srcfile is a filename string
             infile = open(srcfile, 'rt')
         else:


More information about the Yum-commits mailing list