]> granicus.if.org Git - python/commitdiff
Merged revisions 85814 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Sun, 24 Oct 2010 03:00:35 +0000 (03:00 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 24 Oct 2010 03:00:35 +0000 (03:00 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85814 | benjamin.peterson | 2010-10-23 21:52:05 -0500 (Sat, 23 Oct 2010) | 1 line

  remove broken code accounting an offset the size of the line #10186
........

Misc/NEWS
Python/pythonrun.c

index d25e25ec2f949a73818e37cf6c378c63dcd1096e..41d90d0f967f72efe6a9b481ae1fd1fe594a87d4 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,9 @@ Core and Builtins
 - Issue #10125: Don't segfault when the iterator passed to ``file.writelines()``
   closes the file.
 
+- Issue #10186: Fix the SyntaxError caret when the offset is equal to the length
+  of the offending line.
+
 - Issue #9997: Don't let the name "top" have special significance in scope
   resolution.
 
index 7f63ae108cdf55b136696f34cb45ba48e998415e..f3b4e5044ea52feb031f48709f4fcc1377410591 100644 (file)
@@ -1045,8 +1045,6 @@ print_error_text(PyObject *f, int offset, const char *text)
 {
     char *nl;
     if (offset >= 0) {
-        if (offset > 0 && offset == (int)strlen(text))
-            offset--;
         for (;;) {
             nl = strchr(text, '\n');
             if (nl == NULL || nl-text >= offset)