From 8064fa121fce17426a4fca457206db721d7ad7d6 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 29 Jan 2010 18:52:28 +0000 Subject: [PATCH] Fix AttributeError from has_versions for atoms with no USE deps. Thanks to Arfrever for reporting. (trunk r15214) svn path=/main/branches/2.1.7/; revision=15265 --- bin/portageq | 4 ++-- pym/portage/dep.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/portageq b/bin/portageq index 909876cc8..5cae93155 100755 --- a/bin/portageq +++ b/bin/portageq @@ -47,8 +47,8 @@ from portage import os from portage.util import writemsg, writemsg_stdout def eval_atom_use(atom): - if atom.use.conditional and 'USE' in os.environ: - use = os.environ['USE'].split() + if 'USE' in os.environ: + use = frozenset(os.environ['USE'].split()) atom = atom.evaluate_conditionals(use) return atom diff --git a/pym/portage/dep.py b/pym/portage/dep.py index c241408a5..fe3f04f59 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -620,7 +620,7 @@ class Atom(_atom_base): @rtype: Atom @return: an atom instance with any USE conditionals evaluated """ - if not self.use.conditional: + if not (self.use and self.use.conditional): return self atom = remove_slot(self) if self.slot: -- 2.26.2