Copyright (C) 2000-2012 |
GNU Info (python2.1-tut.info)Raising ExceptionsRaising Exceptions ================== The `raise' statement allows the programmer to force a specified exception to occur. For example: >>> raise NameError, 'HiThere' Traceback (most recent call last): File "<stdin>", line 1 NameError: HiThere The first argument to `raise' names the exception to be raised. The optional second argument specifies the exception's argument. automatically generated by info2www version 1.2.2.9 |