FIX use safe_getattr instead of getattr for Python 3.9 compat
This commit is contained in:
parent
c0dfc45186
commit
80a3322d32
|
@ -46,7 +46,7 @@ from _pytest._code.source import Source
|
||||||
from _pytest._io import TerminalWriter
|
from _pytest._io import TerminalWriter
|
||||||
from _pytest._io.saferepr import safeformat
|
from _pytest._io.saferepr import safeformat
|
||||||
from _pytest._io.saferepr import saferepr
|
from _pytest._io.saferepr import saferepr
|
||||||
from _pytest.compat import get_real_func
|
from _pytest.compat import get_real_func, safe_getattr
|
||||||
from _pytest.deprecated import check_ispytest
|
from _pytest.deprecated import check_ispytest
|
||||||
from _pytest.pathlib import absolutepath
|
from _pytest.pathlib import absolutepath
|
||||||
from _pytest.pathlib import bestrelpath
|
from _pytest.pathlib import bestrelpath
|
||||||
|
@ -702,7 +702,7 @@ class ExceptionInfo(Generic[E]):
|
||||||
return "\n".join(
|
return "\n".join(
|
||||||
[
|
[
|
||||||
str(exc),
|
str(exc),
|
||||||
*getattr(exc, "__notes__", []),
|
*safe_getattr(exc, "__notes__", []),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue