PrettyErrors icon indicating copy to clipboard operation
PrettyErrors copied to clipboard

SyntaxError messages just say 'invalid syntax' instead of the provided hints

Open Uchiha-Senju opened this issue 1 year ago • 1 comments

Issue

When printing a syntax error, the exception includes a help message in the msg attribute, but the message in args[0] is printed instead, which is almost always "invalid syntax" and unhelpful.

Currently: image

Ideally : image

Suggested Fix :

Changing line 682 in init.py from exception_value.args = [exception_value.args[0]] to exception_value.args = [exception_value.msg]

Uchiha-Senju avatar May 19 '23 12:05 Uchiha-Senju

could you possibly PR this?

aymuos15 avatar Mar 27 '24 12:03 aymuos15