Skip to content

Commit ec9f9f5

Browse files
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) ........
1 parent 638cee6 commit ec9f9f5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)