Fix 2 more types.InstanceType comparisons that are broken by
authorZac Medico <zmedico@gentoo.org>
Wed, 30 Apr 2008 19:45:54 +0000 (19:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 30 Apr 2008 19:45:54 +0000 (19:45 -0000)
the transition of dbapi to new-style classes. (trunk r6188)

svn path=/main/branches/2.1.2/; revision=10049

pym/portage.py

index 61f82698e0240415896d388f2cf977c8cbfe2c16..d90b4027dcd7299a457bb39e5acc04ab83eb8e18 100644 (file)
@@ -5818,7 +5818,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 mydb.categories:
                                if mydb.cp_list(x+"/"+mykey,use_cache=use_cache):
                                        return x+"/"+mykey
@@ -5826,7 +5826,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