mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
This commit is contained in:
parent
4001e96179
commit
737fb89dd1
36 changed files with 54 additions and 54 deletions
|
@ -718,7 +718,7 @@ parser_tuple2st(PyST_Object *self, PyObject *args, PyObject *kw)
|
|||
err_string("parse tree does not use a valid start symbol");
|
||||
}
|
||||
}
|
||||
/* Make sure we throw an exception on all errors. We should never
|
||||
/* Make sure we raise an exception on all errors. We should never
|
||||
* get this, but we'd do well to be sure something is done.
|
||||
*/
|
||||
if (st == NULL && !PyErr_Occurred())
|
||||
|
@ -824,7 +824,7 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
|
|||
else if (!ISNONTERMINAL(type)) {
|
||||
/*
|
||||
* It has to be one or the other; this is an error.
|
||||
* Throw an exception.
|
||||
* Raise an exception.
|
||||
*/
|
||||
PyObject *err = Py_BuildValue("os", elem, "unknown node type.");
|
||||
PyErr_SetObject(parser_error, err);
|
||||
|
@ -876,7 +876,7 @@ build_node_tree(PyObject *tuple)
|
|||
if (ISTERMINAL(num)) {
|
||||
/*
|
||||
* The tuple is simple, but it doesn't start with a start symbol.
|
||||
* Throw an exception now and be done with it.
|
||||
* Raise an exception now and be done with it.
|
||||
*/
|
||||
tuple = Py_BuildValue("os", tuple,
|
||||
"Illegal syntax-tree; cannot start with terminal symbol.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue