Skip to content

Commit

Permalink
Merge pull request #4 from lc-at/localized_exceptions
Browse files Browse the repository at this point in the history
`PyErr_GetLocalizedException` on `_PyPegen_raise_error_known_location`
  • Loading branch information
tonybaloney authored Oct 25, 2024
2 parents df8066b + e8fe7c9 commit e337d95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ def exists(path):
sys.localized_exceptions['id']['division by zero'] = "pembagian dengan nol"
sys.localized_exceptions['id']["unsupported operand type(s) for %.100s: '%.100s' and '%.100s'"] = "tipe operan tidak didukung untuk %.100s: '%.100s' dan '%.100s'"
sys.localized_exceptions['id']["unmatched '%c'"] = "'%c' tanpa pasangan"
sys.localized_exceptions['id']["invalid syntax"] = "sintaks tidak valid"


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion Parser/pegen_errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ _PyPegen_raise_error_known_location(Parser *p, PyObject *errtype,
end_col_offset = p->tok->cur - p->tok->line_start;
}

errstr = PyUnicode_FromFormatV(errmsg, va);
errstr = PyUnicode_FromFormatV(PyErr_GetLocalizedException(errmsg), va);
if (!errstr) {
goto error;
}
Expand Down

0 comments on commit e337d95

Please sign in to comment.