From 7b0908a8e444d735d459bac7c32566f6f11882fe Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=89ric=20Araujo?= Date: Fri, 29 Jul 2011 02:32:41 +0200 Subject: [PATCH] Make TypeError message from Command.__init__ more useful --- Lib/packaging/command/cmd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/packaging/command/cmd.py b/Lib/packaging/command/cmd.py index fa56aa63f6..1053ac390a 100644 --- a/Lib/packaging/command/cmd.py +++ b/Lib/packaging/command/cmd.py @@ -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") -- 2.49.0