summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-05 04:43:39 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-05 04:43:39 +0000
commit7a0ef076761ee1dd6e41765f608071ede1b70ba8 (patch)
tree6aad7f580e91a4b935ffdede17203f7096aca638
parent41caf107f990e4d4f45a641d1caf0f12f21895bc (diff)
downloadportage-7a0ef076761ee1dd6e41765f608071ede1b70ba8.tar.gz
portage-7a0ef076761ee1dd6e41765f608071ede1b70ba8.tar.bz2
portage-7a0ef076761ee1dd6e41765f608071ede1b70ba8.zip
Use basestring instead of str for isinstance check inside use_reduce() so
that it works with unicode and remove related unicode to str workaround code from the sqlite cache module. svn path=/main/trunk/; revision=12757
-rw-r--r--pym/portage/cache/sqlite.py7
-rw-r--r--pym/portage/dep.py3
2 files changed, 3 insertions, 7 deletions
diff --git a/pym/portage/cache/sqlite.py b/pym/portage/cache/sqlite.py
index 3e287f7ba..aa5c30468 100644
--- a/pym/portage/cache/sqlite.py
+++ b/pym/portage/cache/sqlite.py
@@ -163,12 +163,7 @@ class database(fs_template.FsBased):
column_index +=1
if k not in internal_columns:
d[k] = result[0][column_index]
- # XXX: The resolver chokes on unicode strings so we convert them here.
- for k in d.keys():
- try:
- d[k]=str(d[k]) # convert unicode strings to normal
- except UnicodeEncodeError, e:
- pass #writemsg("%s: %s\n" % (cpv, str(e)))
+
return d
def _setitem(self, cpv, values):
diff --git a/pym/portage/dep.py b/pym/portage/dep.py
index 4a9d85e3c..48465ddbe 100644
--- a/pym/portage/dep.py
+++ b/pym/portage/dep.py
@@ -243,7 +243,8 @@ def use_reduce(deparray, uselist=[], masklist=[], matchall=0, excludeall=[]):
if head[-1:] == "?": # Use reduce next group on fail.
# Pull any other use conditions and the following atom or list into a separate array
newdeparray = [head]
- while isinstance(newdeparray[-1], str) and newdeparray[-1][-1] == "?":
+ while isinstance(newdeparray[-1], basestring) and \
+ newdeparray[-1][-1:] == "?":
if mydeparray:
newdeparray.append(mydeparray.pop(0))
else: