generalized reprcrash assignment in code.py

This commit is contained in:
acjreno 2023-04-15 17:51:02 -04:00
parent e4964ff580
commit a6bafe8298
2 changed files with 2 additions and 4 deletions

View File

@ -977,9 +977,7 @@ class FormattedExcinfo:
) )
else: else:
reprtraceback = self.repr_traceback(excinfo_) reprtraceback = self.repr_traceback(excinfo_)
reprcrash: Optional[ReprFileLocation] = ( reprcrash = excinfo_._getreprcrash()
excinfo_._getreprcrash() if self.style != "value" else None
)
else: else:
# Fallback to native repr if the exception doesn't have a traceback: # Fallback to native repr if the exception doesn't have a traceback:
# ExceptionInfo objects require a full traceback to work. # ExceptionInfo objects require a full traceback to work.

View File

@ -445,7 +445,7 @@ class Node(metaclass=NodeMeta):
if isinstance(excinfo.value, ConftestImportFailure): if isinstance(excinfo.value, ConftestImportFailure):
excinfo = ExceptionInfo.from_exc_info(excinfo.value.excinfo) excinfo = ExceptionInfo.from_exc_info(excinfo.value.excinfo)
if isinstance(excinfo.value, fail.Exception): if isinstance(excinfo.value, fail.Exception):
if not excinfo.value.pytrace and style != "line": if not excinfo.value.pytrace:
style = "value" style = "value"
if isinstance(excinfo.value, FixtureLookupError): if isinstance(excinfo.value, FixtureLookupError):
return excinfo.value.formatrepr() return excinfo.value.formatrepr()