Skip to content

Conversation

@hugovk
Copy link
Member

@hugovk hugovk commented Dec 28, 2022

New users often struggle with tracebacks, especially when they're long.

This is a small change to help simplify the output and avoid repetition in tracebacks.

Before

Here's a simple example from https://github.com/henryiii/flake8-errmsg:

sub = "Some value"
raise RuntimeError(f"{sub!r} is incorrect")
Traceback (most recent call last):
  File "tmp.py", line 2, in <module>
    raise RuntimeError(f"{sub!r} is incorrect")
RuntimeError: 'Some value' is incorrect

After

sub = "Some value"
msg = f"{sub!r} is incorrect"
raise RuntimeError(msg)
Traceback (most recent call last):
  File "tmp.py", line 3, in <module>
    raise RuntimeError(msg)
RuntimeError: 'Some value' is incorrect

@radarhere radarhere merged commit c7f633c into python-pillow:main Dec 30, 2022
@hugovk hugovk deleted the flake8-errmsg branch December 30, 2022 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants