mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 03:05:00 +00:00
handle missing end_lineno attr #619
This commit is contained in:
parent
0da01dacb6
commit
ad2312ad7b
1 changed files with 2 additions and 1 deletions
|
@ -130,7 +130,8 @@ def lint_python_compile(fname, code):
|
||||||
compile(code, fname, "exec") # USE TRACEBACK BELOW HERE
|
compile(code, fname, "exec") # USE TRACEBACK BELOW HERE
|
||||||
return
|
return
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
line_numbers = list(range(err.lineno - 1, err.end_lineno))
|
end_lineno = getattr(err, "end_lineno", err.lineno)
|
||||||
|
line_numbers = list(range(err.lineno - 1, end_lineno))
|
||||||
|
|
||||||
tb_lines = traceback.format_exception(type(err), err, err.__traceback__)
|
tb_lines = traceback.format_exception(type(err), err, err.__traceback__)
|
||||||
last_file_i = 0
|
last_file_i = 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue