diff Modules/parsermodule.c @ 80928:fdf907708f49 3.2

Issue #16714: use 'raise' exceptions, don't 'throw'. Patch by Serhiy Storchaka.
author Andrew Svetlov <andrew.svetlov@gmail.com>
date Tue, 18 Dec 2012 21:14:22 +0200
parents 56dc7b09f390
children 15a391919deb
line wrap: on
line diff
--- a/Modules/parsermodule.c	Tue Dec 18 15:48:10 2012 +0200
+++ b/Modules/parsermodule.c	Tue Dec 18 21:14:22 2012 +0200
@@ -718,7 +718,7 @@
             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 @@
         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 @@
     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.");