diff options
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 3e8c6f5dae..e7216147a8 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -390,7 +390,7 @@ error_at_directive(PySTEntryObject *ste, PyObject *name) if (PyUnicode_Compare(PyTuple_GET_ITEM(data, 0), name) == 0) { PyErr_SyntaxLocationObject(ste->ste_table->st_filename, PyLong_AsLong(PyTuple_GET_ITEM(data, 1)), - PyLong_AsLong(PyTuple_GET_ITEM(data, 2))); + PyLong_AsLong(PyTuple_GET_ITEM(data, 2)) + 1); return 0; } @@ -990,7 +990,7 @@ symtable_add_def(struct symtable *st, PyObject *name, int flag) PyErr_Format(PyExc_SyntaxError, DUPLICATE_ARGUMENT, name); PyErr_SyntaxLocationObject(st->st_filename, st->st_cur->ste_lineno, - st->st_cur->ste_col_offset); + st->st_cur->ste_col_offset + 1); goto error; } val |= flag; @@ -1179,7 +1179,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) e_name->v.Name.id); PyErr_SyntaxLocationObject(st->st_filename, s->lineno, - s->col_offset); + s->col_offset + 1); VISIT_QUIT(st, 0); } if (s->v.AnnAssign.simple && @@ -1274,7 +1274,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) msg, name); PyErr_SyntaxLocationObject(st->st_filename, s->lineno, - s->col_offset); + s->col_offset + 1); VISIT_QUIT(st, 0); } if (!symtable_add_def(st, name, DEF_GLOBAL)) @@ -1306,7 +1306,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s) PyErr_Format(PyExc_SyntaxError, msg, name); PyErr_SyntaxLocationObject(st->st_filename, s->lineno, - s->col_offset); + s->col_offset + 1); VISIT_QUIT(st, 0); } if (!symtable_add_def(st, name, DEF_NONLOCAL)) @@ -1645,7 +1645,7 @@ symtable_visit_alias(struct symtable *st, alias_ty a) int lineno = st->st_cur->ste_lineno; int col_offset = st->st_cur->ste_col_offset; PyErr_SetString(PyExc_SyntaxError, IMPORT_STAR_WARNING); - PyErr_SyntaxLocationObject(st->st_filename, lineno, col_offset); + PyErr_SyntaxLocationObject(st->st_filename, lineno, col_offset + 1); Py_DECREF(store_name); return 0; } @@ -1736,7 +1736,7 @@ symtable_handle_comprehension(struct symtable *st, expr_ty e, "'yield' inside generator expression"); PyErr_SyntaxLocationObject(st->st_filename, st->st_cur->ste_lineno, - st->st_cur->ste_col_offset); + st->st_cur->ste_col_offset + 1); symtable_exit_block(st, (void *)e); return 0; } |