mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Make TypeError message from Command.__init__ more useful
This commit is contained in:
parent
943006bf68
commit
7b0908a8e4
1 changed files with 2 additions and 1 deletions
|
@ -57,7 +57,8 @@ class Command:
|
||||||
from packaging.dist import Distribution
|
from packaging.dist import Distribution
|
||||||
|
|
||||||
if not isinstance(dist, 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:
|
if self.__class__ is Command:
|
||||||
raise RuntimeError("Command is an abstract class")
|
raise RuntimeError("Command is an abstract class")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue