Merge pull request #7837 from asottile/py36_union_pattern_match

py36+: remove workaround for Union[Pattern/Match] bug
This commit is contained in:
Anthony Sottile
2020-10-02 19:47:50 -07:00
committed by GitHub
3 changed files with 7 additions and 7 deletions

View File

@@ -562,7 +562,7 @@ _E = TypeVar("_E", bound=BaseException)
def raises(
expected_exception: Union["Type[_E]", Tuple["Type[_E]", ...]],
*,
match: "Optional[Union[str, Pattern[str]]]" = ...
match: Optional[Union[str, Pattern[str]]] = ...
) -> "RaisesContext[_E]":
...
@@ -740,7 +740,7 @@ class RaisesContext(Generic[_E]):
self,
expected_exception: Union["Type[_E]", Tuple["Type[_E]", ...]],
message: str,
match_expr: Optional[Union[str, "Pattern[str]"]] = None,
match_expr: Optional[Union[str, Pattern[str]]] = None,
) -> None:
self.expected_exception = expected_exception
self.message = message