portage.cpv_expand(). It inherits from ValueError, for
backward compatibility with calling code that already
handles ValueError.
svn path=/main/trunk/; revision=11670
else:
virtual_name_collision = True
if not virtual_name_collision:
- raise ValueError, matches
+ # AmbiguousPackageName inherits from ValueError,
+ # for backward compatibility with calling code
+ # that already handles ValueError.
+ raise portage.exception.AmbiguousPackageName(matches)
elif matches:
mykey=matches[0]
class CommandNotFound(PortageException):
"""A required binary was not available or executable"""
+class AmbiguousPackageName(ValueError, PortageException):
+ """Raised by portage.cpv_expand() when the package name is ambiguous due
+ to the existence of multiple matches in different categories. This inherits
+ from ValueError, for backward compatibility with calling code that already
+ handles ValueError."""
+ def __str__(self):
+ return ValueError.__str__(self)
class PortagePackageException(PortageException):
"""Malformed or missing package data"""