Merged revisions 85814 via svnmerge from

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
........
This commit is contained in:
Benjamin Peterson 2010-10-24 03:00:35 +00:00
parent e395752bcc
commit f99f33da60
2 changed files with 3 additions and 2 deletions

View file

@ -13,6 +13,9 @@ Core and Builtins
- Issue #10125: Don't segfault when the iterator passed to ``file.writelines()`` - Issue #10125: Don't segfault when the iterator passed to ``file.writelines()``
closes the file. 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 - Issue #9997: Don't let the name "top" have special significance in scope
resolution. resolution.

View file

@ -1045,8 +1045,6 @@ print_error_text(PyObject *f, int offset, const char *text)
{ {
char *nl; char *nl;
if (offset >= 0) { if (offset >= 0) {
if (offset > 0 && offset == (int)strlen(text))
offset--;
for (;;) { for (;;) {
nl = strchr(text, '\n'); nl = strchr(text, '\n');
if (nl == NULL || nl-text >= offset) if (nl == NULL || nl-text >= offset)