diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-27 19:15:50 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-27 19:15:50 -0700 |
commit | be0a2cb03d5017da1bfa085b89347608988ccdf1 (patch) | |
tree | d927f1f9b458459db028d3ef00f60cd46091642e | |
parent | c68ab8f601e98b3240f812b616b0aeed0fd29776 (diff) | |
download | portage-be0a2cb03d5017da1bfa085b89347608988ccdf1.tar.gz portage-be0a2cb03d5017da1bfa085b89347608988ccdf1.tar.bz2 portage-be0a2cb03d5017da1bfa085b89347608988ccdf1.zip |
Use StopIteration to exit nested loops.v2.2_rc70
-rw-r--r-- | pym/portage/dep/__init__.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index c5f6a0b63..382a4f611 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -1087,11 +1087,15 @@ class Atom(_atom_base): % (eapi, self), category='EAPI.incompatible') if is_valid_flag is not None and self.use.conditional: invalid_flag = None - for conditional_type, flags in self.use.conditional.items(): - for flag in flags: - if not is_valid_flag(flag): - invalid_flag = (conditional_type, flag) - break + try: + for conditional_type, flags in \ + self.use.conditional.items(): + for flag in flags: + if not is_valid_flag(flag): + invalid_flag = (conditional_type, flag) + raise StopIteration() + except StopIteration: + pass if invalid_flag is not None: conditional_type, flag = invalid_flag conditional_str = _use_dep._conditional_strings[conditional_type] |