Skip to content

Commit

Permalink
Correct typing for things that handle exceptions
Browse files Browse the repository at this point in the history
They really handle BaseException, so document as such!
  • Loading branch information
cjw296 committed Jun 5, 2024
1 parent 9d63918 commit 4ee63aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion testfixtures/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def compare_object(


def compare_exception(
x: Exception, y: Exception, context: 'CompareContext'
x: BaseException, y: BaseException, context: 'CompareContext'
) -> Optional[str]:
"""
Compare the two supplied exceptions based on their message, type and
Expand Down
2 changes: 1 addition & 1 deletion testfixtures/shouldraise.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from testfixtures import diff, compare

ExceptionOrType = Union[Exception, Type[Exception]]
ExceptionOrType = Union[BaseException, Type[BaseException]]


param_docs = """
Expand Down

0 comments on commit 4ee63aa

Please sign in to comment.