Skip to content

gh-111448: Make traceback.format_exception_only respect max_group_width and max_group_depth #111952

New issue

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Nov 10, 2023

@sobolevn sobolevn changed the title gh-111448: Add limit_group parameter to traceback.format_exception_only gh-111448: Make traceback.format_exception_only respect max_group_width and max_group_depth Nov 11, 2023
yield from [indent + l + '\n' for l in note.split('\n')]
elif self.__notes__ is not None:
yield indent + "{}\n".format(_safe_string(self.__notes__, '__notes__', func=repr))
limit = self.max_group_depth
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems that there is a lot of repetition now between format and format_exception_only. Could we not have format take an arg to makes it skip the traceback (so that it becomes format_exception_only)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take a look 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants