diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_with.py | 4 | ||||
-rw-r--r-- | Lib/traceback.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_with.py b/Lib/test/test_with.py index 105be8b..ae2fa4d 100644 --- a/Lib/test/test_with.py +++ b/Lib/test/test_with.py @@ -677,7 +677,7 @@ class NestedWith(unittest.TestCase): if self.gobble: return True - class CtorRaises(object): + class InitRaises(object): def __init__(self): raise RuntimeError() class EnterRaises(object): @@ -697,7 +697,7 @@ class NestedWith(unittest.TestCase): def testExceptionInExprList(self): try: - with self.Dummy() as a, self.CtorRaises(): + with self.Dummy() as a, self.InitRaises(): pass except: pass diff --git a/Lib/traceback.py b/Lib/traceback.py index 571ff57..5f92415 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 |