Skip to content

Commit 1c54dad

Browse files
author
benjamin.peterson
committed
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) ........ git-svn-id: http://svn.python.org/projects/python/branches/release27-maint@85905 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 1cb4c7c commit 1c54dad

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Python/pythonrun.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,8 @@ print_error_text(PyObject *f, int offset, const char *text)
10451045
{
10461046
char *nl;
10471047
if (offset >= 0) {
1048+
if (offset > 0 && offset == strlen(text) && text[offset - 1] == '\n')
1049+
offset--;
10481050
for (;;) {
10491051
nl = strchr(text, '\n');
10501052
if (nl == NULL || nl-text >= offset)

0 commit comments

Comments
 (0)