1414import os
1515from pathlib import Path
1616import re
17- from re import Pattern
1817import sys
1918import traceback
2019from traceback import format_exception_only
@@ -705,7 +704,7 @@ def _stringify_exception(self, exc: BaseException) -> str:
705704 ]
706705 )
707706
708- def match (self , regexp : str | Pattern [str ]) -> Literal [True ]:
707+ def match (self , regexp : str | re . Pattern [str ]) -> Literal [True ]:
709708 """Check whether the regular expression `regexp` matches the string
710709 representation of the exception using :func:`python:re.search`.
711710
@@ -724,7 +723,7 @@ def _group_contains(
724723 self ,
725724 exc_group : BaseExceptionGroup [BaseException ],
726725 expected_exception : EXCEPTION_OR_MORE ,
727- match : str | Pattern [str ] | None ,
726+ match : str | re . Pattern [str ] | None ,
728727 target_depth : int | None = None ,
729728 current_depth : int = 1 ,
730729 ) -> bool :
@@ -754,7 +753,7 @@ def group_contains(
754753 self ,
755754 expected_exception : EXCEPTION_OR_MORE ,
756755 * ,
757- match : str | Pattern [str ] | None = None ,
756+ match : str | re . Pattern [str ] | None = None ,
758757 depth : int | None = None ,
759758 ) -> bool :
760759 """Check whether a captured exception group contains a matching exception.
@@ -763,7 +762,7 @@ def group_contains(
763762 The expected exception type, or a tuple if one of multiple possible
764763 exception types are expected.
765764
766- :param str | Pattern[str] | None match:
765+ :param str | re. Pattern[str] | None match:
767766 If specified, a string containing a regular expression,
768767 or a regular expression object, that is tested against the string
769768 representation of the exception and its `PEP-678 <https://peps.python.org/pep-0678/>` `__notes__`
0 commit comments