Staging
v0.8.1
Revision 15bc9ab301d73f20bff47a12ef05326feb40f797 authored by Guido van Rossum on 15 May 2020, 02:22:48 UTC, committed by GitHub on 15 May 2020, 02:22:48 UTC


This fixes both the traceback.py module and the C code for formatting syntax errors (in Python/pythonrun.c). They now both consistently do the following:

- Suppress caret if it points left of text
- Allow caret pointing just past end of line
- If caret points past end of line, clip to *just* past end of line

The syntax error formatting code in traceback.py was mostly rewritten; small, subtle changes were applied to the C code in pythonrun.c.

There's still a difference when the text contains embedded newlines. Neither handles these very well, and I don't think the case occurs in practice.

Automerge-Triggered-By: @gvanrossum
1 parent 1aa8767
History
File Mode Size
abstract.h -rw-r--r-- 13.9 KB
bytearrayobject.h -rw-r--r-- 769 bytes
bytesobject.h -rw-r--r-- 4.0 KB
ceval.h -rw-r--r-- 1.5 KB
code.h -rw-r--r-- 6.8 KB
dictobject.h -rw-r--r-- 3.7 KB
fileobject.h -rw-r--r-- 951 bytes
fileutils.h -rw-r--r-- 3.9 KB
frameobject.h -rw-r--r-- 3.0 KB
import.h -rw-r--r-- 1.4 KB
initconfig.h -rw-r--r-- 15.9 KB
interpreteridobject.h -rw-r--r-- 456 bytes
listobject.h -rw-r--r-- 1.3 KB
methodobject.h -rw-r--r-- 1.4 KB
object.h -rw-r--r-- 18.9 KB
objimpl.h -rw-r--r-- 4.4 KB
pyerrors.h -rw-r--r-- 4.9 KB
pylifecycle.h -rw-r--r-- 2.0 KB
pymem.h -rw-r--r-- 3.4 KB
pystate.h -rw-r--r-- 9.9 KB
sysmodule.h -rw-r--r-- 575 bytes
traceback.h -rw-r--r-- 473 bytes
tupleobject.h -rw-r--r-- 1.0 KB
unicodeobject.h -rw-r--r-- 44.8 KB

back to top