summaryrefslogtreecommitdiffstats
path: root/pym/portage
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage')
-rw-r--r--pym/portage/dep/__init__.py8
-rw-r--r--pym/portage/exception.py3
2 files changed, 8 insertions, 3 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 499b43fc0..36b655f7c 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -307,9 +307,11 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
if is_valid_flag:
if not is_valid_flag(flag):
- raise portage.exception.InvalidDependString(
- _("use flag '%s' is not referencable in conditional '%s' (flag missing from IUSE?)") \
- % (flag, conditional))
+ msg = _("USE flag '%s' referenced in " + \
+ "conditional '%s' is not in IUSE") \
+ % (flag, conditional)
+ e = InvalidData(msg, category='IUSE.missing')
+ raise portage.exception.InvalidDependString(msg, errors=(e,))
else:
if _valid_use_re.match(flag) is None:
raise portage.exception.InvalidDependString(
diff --git a/pym/portage/exception.py b/pym/portage/exception.py
index b289b6285..9564af98a 100644
--- a/pym/portage/exception.py
+++ b/pym/portage/exception.py
@@ -52,6 +52,9 @@ class ParseError(PortageException):
class InvalidData(PortageException):
"""An incorrect formatting was passed instead of the expected one"""
+ def __init__(self, value, category=None):
+ PortageException.__init__(self, value)
+ self.category = category
class InvalidDataType(PortageException):
"""An incorrect type was passed instead of the expected one"""