Skip to content

Commit

Permalink
Add re.Pattern to allowed match types
Browse files Browse the repository at this point in the history
Suggested in #436 (comment)
  • Loading branch information
robertschweizer authored Sep 24, 2024
1 parent 60358bb commit ed70a80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tenacity/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class retry_if_exception_message(retry_if_exception):
def __init__(
self,
message: typing.Optional[str] = None,
match: typing.Optional[str] = None,
match: typing.Union[None, str, re.Pattern] = None,
) -> None:
if message and match:
raise TypeError(
Expand Down Expand Up @@ -242,7 +242,7 @@ class retry_if_not_exception_message(retry_if_exception_message):
def __init__(
self,
message: typing.Optional[str] = None,
match: typing.Optional[str] = None,
match: typing.Union[None, str, re.Pattern] = None,
) -> None:
super().__init__(message, match)
# invert predicate
Expand Down

0 comments on commit ed70a80

Please sign in to comment.