Fix TypeError when importing pytest on Python 3.5.0 and 3.5.1
The typing module on these versions have these issues: - `typing.Pattern` cannot appear in a Union since it is not considered a class. - `@overload` is not supported in runtime. (On the other hand, mypy doesn't support putting it under `if False`, so we need some runtime hack). Refs #5751.
This commit is contained in:
@@ -591,7 +591,7 @@ class ExceptionInfo(Generic[_E]):
|
||||
)
|
||||
return fmt.repr_excinfo(self)
|
||||
|
||||
def match(self, regexp: Union[str, Pattern]) -> bool:
|
||||
def match(self, regexp: "Union[str, Pattern]") -> bool:
|
||||
"""
|
||||
Check whether the regular expression 'regexp' is found in the string
|
||||
representation of the exception using ``re.search``. If it matches
|
||||
|
||||
Reference in New Issue
Block a user