Don't show thonny/backend in user stactraces
@@ -2794,10 +2794,14 @@ def format_exception_with_frame_info(e_type, e_value, e_traceback, shorten_filen
tb_temp = tb
for entry in traceback.extract_tb(tb):
assert tb_temp is not None # actual tb doesn't end before extract_tb
- if "cpython_backend" not in entry.filename and (
+ if (
+ "cpython_backend" not in entry.filename
+ and "thonny/backend" not in entry.filename.replace("\\", "/")
+ and (
not entry.filename.endswith(os.sep + "ast.py")
or entry.name != "parse"
or etype is not SyntaxError
+ )
):
fmt = ' File "{}", line {}, in {}\n'.format(
entry.filename, entry.lineno, entry.name
