]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
More two-argument raise cleanup in the tutorial.
authorCollin Winter <collinw@gmail.com>
Mon, 10 Sep 2007 00:36:57 +0000 (00:36 +0000)
committerCollin Winter <collinw@gmail.com>
Mon, 10 Sep 2007 00:36:57 +0000 (00:36 +0000)
Doc/tutorial/errors.rst

index 8281c7f20f3d1cd6bab39745d6790fb75773d530..706e2c0ddffc9c05b6ccc501a0fcf50f0fc769a7 100644 (file)
@@ -221,10 +221,9 @@ exception to occur. For example::
      File "<stdin>", line 1, in ?
    NameError: HiThere
 
-The first argument to :keyword:`raise` names the exception to be raised.  The
-optional second argument specifies the exception's argument.  Alternatively, the
-above could be written as ``raise NameError('HiThere')``.  Either form works
-fine, but there seems to be a growing stylistic preference for the latter.
+The sole argument to :keyword:`raise` indicates the exception to be raised.
+This must be either an exception instance or an exception class (a class that
+derives from :class:`Exception`).
 
 If you need to determine whether an exception was raised but don't intend to
 handle it, a simpler form of the :keyword:`raise` statement allows you to