Kaydet (Commit) eb56aa16 authored tarafından Georg Brandl's avatar Georg Brandl

#3584: ignore trailing newlines when placing the caret for a SyntaxError location.

üst e6632b47
......@@ -189,7 +189,7 @@ def format_exception_only(etype, value):
if badline is not None:
lines.append(' %s\n' % badline.strip())
if offset is not None:
caretspace = badline[:offset].lstrip()
caretspace = badline.rstrip('\n')[:offset].lstrip()
# non-space whitespace (likes tabs) must be kept for alignment
caretspace = ((c.isspace() and c or ' ') for c in caretspace)
# only three spaces to account for offset1 == pos 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment