mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-43950: Print columns in tracebacks (PEP 657) (GH-26958)
The traceback.c and traceback.py mechanisms now utilize the newly added code.co_positions and PyCode_Addr2Location to print carets on the specific expressions involved in a traceback. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com> Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
This commit is contained in:
parent
693cec0e2d
commit
5644c7b3ff
12 changed files with 348 additions and 74 deletions
|
@ -544,7 +544,7 @@ show_warning(PyObject *filename, int lineno, PyObject *text,
|
|||
PyFile_WriteString("\n", f_stderr);
|
||||
}
|
||||
else {
|
||||
_Py_DisplaySourceLine(f_stderr, filename, lineno, 2);
|
||||
_Py_DisplaySourceLine(f_stderr, filename, lineno, 2, NULL, NULL);
|
||||
}
|
||||
|
||||
error:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue