summaryrefslogtreecommitdiff
path: root/Lib/traceback.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-06-04 10:21:10 +0000
committerGeorg Brandl <georg@python.org>2009-06-04 10:21:10 +0000
commit3cfdd9c1d53bdcc95b3779caaa2ab5953b604797 (patch)
treebc4ebcb01dabdce9bd671324faef32000f3176b6 /Lib/traceback.py
parent706824f19f734e5e567f32d989376547c0ae08da (diff)
downloadcpython-git-3cfdd9c1d53bdcc95b3779caaa2ab5953b604797.tar.gz
Merged revisions 73186,73206,73212 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73186 | georg.brandl | 2009-06-03 23:21:09 +0200 (Mi, 03 Jun 2009) | 1 line #6174: fix indentation in code example. ........ r73206 | georg.brandl | 2009-06-04 11:15:12 +0200 (Do, 04 Jun 2009) | 1 line #3584: ignore trailing newlines when placing the caret for a SyntaxError location. ........ r73212 | georg.brandl | 2009-06-04 12:10:41 +0200 (Do, 04 Jun 2009) | 1 line Better name for "Ctor". ........
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 571ff57649..5f92415ce6 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -225,7 +225,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