Atom: require string type for eapi
authorZac Medico <zmedico@gentoo.org>
Sat, 6 Nov 2010 22:48:40 +0000 (15:48 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 24 Nov 2010 02:00:11 +0000 (18:00 -0800)
pym/portage/dep/__init__.py

index 58fded47a0da01facae0093c44a61dbdc00ba24f..7ff54f6f7c171b7f47b3c4741754ca794f06d6b6 100644 (file)
@@ -1138,6 +1138,9 @@ class Atom(_atom_base):
                        self.__dict__['unevaluated_atom'] = self
 
                if eapi is not None:
+                       if not isinstance(eapi, basestring):
+                               raise TypeError('expected eapi argument of ' + \
+                                       '%s, got %s: %s' % (basestring, type(eapi), eapi,))
                        if self.slot and not eapi_has_slot_deps(eapi):
                                raise InvalidAtom(
                                        _("Slot deps are not allowed in EAPI %s: '%s'") \