summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 19:14:22 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 19:14:22 (GMT)
commit737fb89dd15e4db6ef30d25963e774ae09cc49dc (patch)
tree422450a087195dbb9e33c7d73d96fd2f1a5f1fcd /Modules
parent4001e96179543cf056613e65dcedc63716c6bc21 (diff)
downloadcpython-737fb89dd15e4db6ef30d25963e774ae09cc49dc.zip
cpython-737fb89dd15e4db6ef30d25963e774ae09cc49dc.tar.gz
cpython-737fb89dd15e4db6ef30d25963e774ae09cc49dc.tar.bz2
Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/_iomodule.c2
-rw-r--r--Modules/parsermodule.c6
-rw-r--r--Modules/posixmodule.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index e18aec6..cec0671 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -59,7 +59,7 @@ PyDoc_STRVAR(module_doc,
"At the top of the I/O hierarchy is the abstract base class IOBase. It\n"
"defines the basic interface to a stream. Note, however, that there is no\n"
"separation between reading and writing to streams; implementations are\n"
-"allowed to throw an IOError if they do not support a given operation.\n"
+"allowed to raise an IOError if they do not support a given operation.\n"
"\n"
"Extending IOBase is RawIOBase which deals simply with the reading and\n"
"writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide\n"
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index b8732dc..9497aae 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -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.");
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 9f57673..0d2919b 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -349,7 +349,7 @@ static int win32_can_symlink = 0;
#if defined _MSC_VER && _MSC_VER >= 1400
/* Microsoft CRT in VS2005 and higher will verify that a filehandle is
- * valid and throw an assertion if it isn't.
+ * valid and raise an assertion if it isn't.
* Normally, an invalid fd is likely to be a C program error and therefore
* an assertion can be useful, but it does contradict the POSIX standard
* which for write(2) states: