Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
fixes:
- |
Added `re.Pattern` to allowed match types.
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, typing.Pattern[str]] = 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, typing.Pattern[str]] = None,
) -> None:
super().__init__(message, match)
# invert predicate
Expand Down