Skip to content

Commit

Permalink
Merge pull request #265 from hx2A/fix233_2
Browse files Browse the repository at this point in the history
fix stack trace parsing error
  • Loading branch information
hx2A authored Mar 19, 2023
2 parents cf45b03 + c9b2a0a commit 2d56f0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py5_resources/py5_module/py5/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ def handle_exception(println, exc_type, exc_value, exc_tb):
tb = exc_tb.tb_next
while hasattr(tb, 'tb_next') and hasattr(tb, 'tb_frame'):
f_code = tb.tb_frame.f_code
if f_code.co_filename.startswith(_MODULE_INSTALL_DIR) and not f_code.co_name.contains('py5_no_prune'):
if f_code.co_filename.startswith(_MODULE_INSTALL_DIR) and not f_code.co_name.endswith('py5_no_prune'):
py5info.append((Path(f_code.co_filename[(len(_MODULE_INSTALL_DIR) + 1):]).parts,
f_code.co_name))
if trim_tb is None:
trim_tb = prev_tb
elif f_code.co_filename.startswith(_PY5TOOLS_MODULE_INSTALL_DIR) and not f_code.co_name.contains('py5_no_prune'):
elif f_code.co_filename.startswith(_PY5TOOLS_MODULE_INSTALL_DIR) and not f_code.co_name.endswith('py5_no_prune'):
py5info.append((Path(f_code.co_filename[(len(_PY5TOOLS_MODULE_INSTALL_DIR) + 1):]).parts,
f_code.co_name))
if trim_tb is None:
Expand All @@ -122,7 +122,7 @@ def handle_exception(println, exc_type, exc_value, exc_tb):
while m := _PY5_STATIC_CODE_FILENAME_REGEX.search(errmsg):
errmsg = errmsg[m.span()[1]:]
else:
errmsg = "py5 encountered an error in your code:" + errmsg
errmsg = "py5 encountered an error in your code:\n\n" + errmsg

println(errmsg, stderr=True)

Expand Down

0 comments on commit 2d56f0c

Please sign in to comment.