Skip to content

Commit

Permalink
fix: protect os.path.basename call with try/except
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gauthier committed Aug 29, 2024
1 parent 725da4b commit 8f7250e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aider/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ def exception_handler(exc_type, exc_value, exc_traceback):
# Get the filename and line number from the innermost frame
filename = innermost_tb.tb_frame.f_code.co_filename
line_number = innermost_tb.tb_lineno
basename = os.path.basename(filename)
try:
basename = os.path.basename(filename)
except Exception:
basename = filename

# Get the exception type name
exception_type = exc_type.__name__
Expand Down

0 comments on commit 8f7250e

Please sign in to comment.