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:
Ammar Askar 2021-07-04 19:14:33 -04:00 committed by GitHub
parent 693cec0e2d
commit 5644c7b3ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 348 additions and 74 deletions

View file

@ -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: