decrement offset when it points to a newline (#10186 followup)
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index e4ae4ab..7567849 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -295,6 +295,10 @@
             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):