summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_traceback.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-10-29 03:28:14 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-10-29 03:28:14 (GMT)
commita95e977e41ca13ac2677c455e5270cf4018f5838 (patch)
tree8e8e411caf136db1cbad5ec2f5010930f12f3ebe /Lib/test/test_traceback.py
parent47ce965562e5a767a523b9c0ae71bf0603f5bee8 (diff)
downloadcpython-a95e977e41ca13ac2677c455e5270cf4018f5838.zip
cpython-a95e977e41ca13ac2677c455e5270cf4018f5838.tar.gz
cpython-a95e977e41ca13ac2677c455e5270cf4018f5838.tar.bz2
decrement offset when it points to a newline (#10186 followup)
Diffstat (limited to 'Lib/test/test_traceback.py')
-rw-r--r--Lib/test/test_traceback.py4
1 files changed, 4 insertions, 0 deletions
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 @@ 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):