summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-10-29 03:45:34 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-10-29 03:45:34 (GMT)
commitec9f9f535a5d1002d4c661224ec225a9faaaf441 (patch)
tree27015d34e924f21f9c78d7f2a4425e8ac26c3b8b /Python
parent638cee62d5f25abf29290825f1600728f79da002 (diff)
downloadcpython-ec9f9f535a5d1002d4c661224ec225a9faaaf441.zip
cpython-ec9f9f535a5d1002d4c661224ec225a9faaaf441.tar.gz
cpython-ec9f9f535a5d1002d4c661224ec225a9faaaf441.tar.bz2
Merged revisions 85904 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85904 | benjamin.peterson | 2010-10-28 22:28:14 -0500 (Thu, 28 Oct 2010) | 1 line decrement offset when it points to a newline (#10186 followup) ........
Diffstat (limited to 'Python')
-rw-r--r--Python/pythonrun.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index f3b4e50..87ffb39 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1045,6 +1045,8 @@ print_error_text(PyObject *f, int offset, const char *text)
{
char *nl;
if (offset >= 0) {
+ if (offset > 0 && offset == strlen(text) && text[offset - 1] == '\n')
+ offset--;
for (;;) {
nl = strchr(text, '\n');
if (nl == NULL || nl-text >= offset)