decrement offset when it points to a newline (#10186 followup)

This commit is contained in:
Benjamin Peterson 2010-10-29 03:28:14 +00:00
parent 47ce965562
commit a95e977e41
2 changed files with 7 additions and 1 deletions

View file

@ -295,6 +295,10 @@ class BaseExceptionReportingTests:
raise SyntaxError('', ('', 0, 5, 'hello'))
msg = self.get_report(e).splitlines()
self.assertEqual(msg[-2], " ^")
def e():
exec("x = 5 | 4 |")
msg = self.get_report(e).splitlines()
self.assertEqual(msg[-2], ' ^')
class PyExcReportingTests(BaseExceptionReportingTests, unittest.TestCase):