We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
traceback.TracebackException.format_exception_only()
It turns out that this is used by pytest, and so we'll need to add something along the lines of
pytest
import collections, traceback def _safe_string(value, what, func=str): try: return func(value) except: return f"<{what} {func.__name__}() failed>" def format_exception_only_with_note(self): yield from format_exception_only_base(self) if isinstance(self.__notes__, collections.abc.Sequence): for note in self.__notes__: note = _safe_string(note, "note") yield from [l + "\n" for l in note.split("\n")] elif self.__notes__ is not None: yield _safe_string(self.__notes__, "__notes__", func=repr) format_exception_only_base = traceback.TracebackException.format_exception_only traceback.TracebackException.format_exception_only = format_exception_only_with_note
(quick dump from local debugging; I'll arrange a better PR in the next few days)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
It turns out that this is used by
pytest
, and so we'll need to add something along the lines of(quick dump from local debugging; I'll arrange a better PR in the next few days)
The text was updated successfully, but these errors were encountered: