Fix 2 more types.InstanceType comparisons that are broken by the transition of dbapi...
authorZac Medico <zmedico@gentoo.org>
Tue, 6 Mar 2007 20:05:04 +0000 (20:05 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 6 Mar 2007 20:05:04 +0000 (20:05 -0000)
svn path=/main/trunk/; revision=6188

pym/portage/__init__.py

index 3a51aa7ca9c6111e37ed8ad3c275f954555920d1..6457e56604672ea126efbe46ee81317d8d6fa27c 100644 (file)
@@ -4328,7 +4328,7 @@ def key_expand(mykey, mydb=None, use_cache=1, settings=None):
        virts = settings.getvirtuals("/")
        virts_p = settings.get_virts_p("/")
        if len(mysplit)==1:
-               if mydb and type(mydb)==types.InstanceType:
+               if hasattr(mydb, "cp_list"):
                        for x in settings.categories:
                                if mydb.cp_list(x+"/"+mykey,use_cache=use_cache):
                                        return x+"/"+mykey
@@ -4336,7 +4336,7 @@ def key_expand(mykey, mydb=None, use_cache=1, settings=None):
                                return(virts_p[mykey][0])
                return "null/"+mykey
        elif mydb:
-               if type(mydb)==types.InstanceType:
+               if hasattr(mydb, "cp_list"):
                        if (not mydb.cp_list(mykey,use_cache=use_cache)) and virts and virts.has_key(mykey):
                                return virts[mykey][0]
                return mykey