]> granicus.if.org Git - python/commitdiff
Merged revisions 85904 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Fri, 29 Oct 2010 03:45:34 +0000 (03:45 +0000)
committerBenjamin Peterson <benjamin@python.org>
Fri, 29 Oct 2010 03:45:34 +0000 (03:45 +0000)
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)
........

Python/pythonrun.c

index f3b4e5044ea52feb031f48709f4fcc1377410591..87ffb397caf30fa60c7e91c098683d4263116751 100644 (file)
@@ -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)