Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5)

Side by Side Diff: Doc/c-api/exceptions.rst

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/ACKS.txt ('k') | Doc/c-api/number.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 .. highlightlang:: c 1 .. highlightlang:: c
2 2
3 3
4 .. _exceptionhandling: 4 .. _exceptionhandling:
5 5
6 ****************** 6 ******************
7 Exception Handling 7 Exception Handling
8 ****************** 8 ******************
9 9
10 The functions described in this chapter will let you handle and raise Python 10 The functions described in this chapter will let you handle and raise Python
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 This utility function specifies a file descriptor to which a ``'\0'`` byte wi ll 347 This utility function specifies a file descriptor to which a ``'\0'`` byte wi ll
348 be written whenever a signal is received. It returns the previous such file 348 be written whenever a signal is received. It returns the previous such file
349 descriptor. The value ``-1`` disables the feature; this is the initial state . 349 descriptor. The value ``-1`` disables the feature; this is the initial state .
350 This is equivalent to :func:`signal.set_wakeup_fd` in Python, but without any 350 This is equivalent to :func:`signal.set_wakeup_fd` in Python, but without any
351 error checking. *fd* should be a valid file descriptor. The function should 351 error checking. *fd* should be a valid file descriptor. The function should
352 only be called from the main thread. 352 only be called from the main thread.
353 353
354 354
355 .. c:function:: PyObject* PyErr_NewException(char *name, PyObject *base, PyObjec t *dict) 355 .. c:function:: PyObject* PyErr_NewException(char *name, PyObject *base, PyObjec t *dict)
356 356
357 This utility function creates and returns a new exception class. The *name* 357 This utility function creates and returns a new exception object. The *name*
358 argument must be the name of the new exception, a C string of the form 358 argument must be the name of the new exception, a C string of the form
359 ``module.classname``. The *base* and *dict* arguments are normally *NULL*. 359 ``module.class``. The *base* and *dict* arguments are normally *NULL*. This
360 This creates a class object derived from :exc:`Exception` (accessible in C as 360 creates a class object derived from :exc:`Exception` (accessible in C as
361 :c:data:`PyExc_Exception`). 361 :c:data:`PyExc_Exception`).
362 362
363 The :attr:`__module__` attribute of the new class is set to the first part (u p 363 The :attr:`__module__` attribute of the new class is set to the first part (u p
364 to the last dot) of the *name* argument, and the class name is set to the las t 364 to the last dot) of the *name* argument, and the class name is set to the las t
365 part (after the last dot). The *base* argument can be used to specify altern ate 365 part (after the last dot). The *base* argument can be used to specify altern ate
366 base classes; it can either be only one class or a tuple of classes. The *dic t* 366 base classes; it can either be only one class or a tuple of classes. The *dic t*
367 argument can be used to specify a dictionary of class variables and methods. 367 argument can be used to specify a dictionary of class variables and methods.
368 368
369 369
370 .. c:function:: PyObject* PyErr_NewExceptionWithDoc(char *name, char *doc, PyObj ect *base, PyObject *dict) 370 .. c:function:: PyObject* PyErr_NewExceptionWithDoc(char *name, char *doc, PyObj ect *base, PyObject *dict)
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 676
677 (1) 677 (1)
678 This is a base class for other standard exceptions. 678 This is a base class for other standard exceptions.
679 679
680 (2) 680 (2)
681 This is the same as :exc:`weakref.ReferenceError`. 681 This is the same as :exc:`weakref.ReferenceError`.
682 682
683 (3) 683 (3)
684 Only defined on Windows; protect code that uses this by testing that the 684 Only defined on Windows; protect code that uses this by testing that the
685 preprocessor macro ``MS_WINDOWS`` is defined. 685 preprocessor macro ``MS_WINDOWS`` is defined.
OLDNEW
« no previous file with comments | « Doc/ACKS.txt ('k') | Doc/c-api/number.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+