Make TypeError message from Command.__init__ more useful

This commit is contained in:
Éric Araujo 2011-07-29 02:32:41 +02:00
parent 943006bf68
commit 7b0908a8e4
1 changed files with 2 additions and 1 deletions

View File

@ -57,7 +57,8 @@ class Command:
from packaging.dist import Distribution
if not isinstance(dist, Distribution):
raise TypeError("dist must be a Distribution instance")
raise TypeError("dist must be an instance of Distribution, not %r"
% type(dist))
if self.__class__ is Command:
raise RuntimeError("Command is an abstract class")