Skip to content

Commit

Permalink
shell_completion: Raise TypeError instead of Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kx-chen committed Jul 23, 2020
1 parent ac495a3 commit 5cf7e04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/click/shell_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def add_completion_class(name, completion_class):
global available_shells

if not issubclass(completion_class, ShellComplete):
raise Exception("Completion class must extend 'ShellComplete'")
raise TypeError("Completion class must extend 'ShellComplete'")

available_shells[name] = completion_class

Expand Down
2 changes: 1 addition & 1 deletion tests/test_shellcomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def source(self):
def complete(self):
return True

with pytest.raises(Exception, match="Completion class must extend 'ShellComplete'"):
with pytest.raises(TypeError, match="Completion class must extend 'ShellComplete'"):
add_completion_class("myshell", MyComplete)


Expand Down

0 comments on commit 5cf7e04

Please sign in to comment.