From: Zac Medico <zmedico@gentoo.org>
Date: Mon, 21 Sep 2009 13:16:12 +0000 (-0000)
Subject: Make key_expand() always return Atom type.
X-Git-Tag: v2.2_rc42~83
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=24add28602df1b752804f735d3b51fa16b9cdb83;p=portage.git

Make key_expand() always return Atom type.

svn path=/main/trunk/; revision=14319
---

diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index d4b44d29a..4b19cb9d9 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -8068,15 +8068,17 @@ def key_expand(mykey, mydb=None, use_cache=1, settings=None):
 		if hasattr(mydb, "cp_list"):
 			for x in mydb.categories:
 				if mydb.cp_list(x+"/"+mykey,use_cache=use_cache):
-					return x+"/"+mykey
+					return dep.Atom(x + "/" + mykey)
 			if mykey in virts_p:
 				return(virts_p[mykey][0])
-		return "null/"+mykey
+		return dep.Atom("null/" + mykey)
 	elif mydb:
 		if hasattr(mydb, "cp_list"):
 			if not mydb.cp_list(mykey, use_cache=use_cache) and \
 				virts and mykey in virts:
 				return virts[mykey][0]
+		if not isinstance(mykey, dep.Atom):
+			mykey = dep.Atom(mykey)
 		return mykey
 
 def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):