| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -364,7 +364,7 @@ an error value). | |||
| 364 | 364 | .. c:function:: int PyErr_ResourceWarning(PyObject *source, Py_ssize_t stack_level, const char *format, ...) | |
| 365 | 365 | ||
| 366 | 366 | Function similar to :c:func:`PyErr_WarnFormat`, but *category* is | |
| 367 | - :exc:`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`. | ||
| 367 | + :exc:`ResourceWarning` and it passes *source* to :class:`!warnings.WarningMessage`. | ||
| 368 | 368 | ||
| 369 | 369 | .. versionadded:: 3.6 | |
| 370 | 370 | ||
@@ -647,7 +647,7 @@ Exception Classes | |||
| 647 | 647 | This creates a class object derived from :exc:`Exception` (accessible in C as | |
| 648 | 648 | :c:data:`PyExc_Exception`). | |
| 649 | 649 | ||
| 650 | - The :attr:`__module__` attribute of the new class is set to the first part (up | ||
| 650 | + The :attr:`!__module__` attribute of the new class is set to the first part (up | ||
| 651 | 651 | to the last dot) of the *name* argument, and the class name is set to the last | |
| 652 | 652 | part (after the last dot). The *base* argument can be used to specify alternate | |
| 653 | 653 | base classes; it can either be only one class or a tuple of classes. The *dict* | |
@@ -797,8 +797,8 @@ because the :ref:`call protocol <call>` takes care of recursion handling. | |||
| 797 | 797 | ||
| 798 | 798 | Marks a point where a recursive C-level call is about to be performed. | |
| 799 | 799 | ||
| 800 | - If :c:macro:`USE_STACKCHECK` is defined, this function checks if the OS | ||
| 801 | - stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it | ||
| 800 | + If :c:macro:`!USE_STACKCHECK` is defined, this function checks if the OS | ||
| 801 | + stack overflowed using :c:func:`PyOS_CheckStack`. If this is the case, it | ||
| 802 | 802 | sets a :exc:`MemoryError` and returns a nonzero value. | |
| 803 | 803 | ||
| 804 | 804 | The function then checks if the recursion limit is reached. If this is the | |
@@ -1051,11 +1051,11 @@ These are compatibility aliases to :c:data:`PyExc_OSError`: | |||
| 1051 | 1051 | +-------------------------------------+----------+ | |
| 1052 | 1052 | | C Name | Notes | | |
| 1053 | 1053 | +=====================================+==========+ | |
| 1054 | - | :c:data:`PyExc_EnvironmentError` | | | ||
| 1054 | + | :c:data:`!PyExc_EnvironmentError` | | | ||
| 1055 | 1055 | +-------------------------------------+----------+ | |
| 1056 | - | :c:data:`PyExc_IOError` | | | ||
| 1056 | + | :c:data:`!PyExc_IOError` | | | ||
| 1057 | 1057 | +-------------------------------------+----------+ | |
| 1058 | - | :c:data:`PyExc_WindowsError` | [2]_ | | ||
| 1058 | + | :c:data:`!PyExc_WindowsError` | [2]_ | | ||
| 1059 | 1059 | +-------------------------------------+----------+ | |
| 1060 | 1060 | ||
| 1061 | 1061 | .. versionchanged:: 3.3 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,7 @@ | |||
| 5 | 5 | Operating System Utilities | |
| 6 | 6 | ========================== | |
| 7 | 7 | ||
| 8 | + | ||
| 8 | 9 | .. c:function:: PyObject* PyOS_FSPath(PyObject *path) | |
| 9 | 10 | ||
| 10 | 11 | Return the file system representation for *path*. If the object is a | |
@@ -95,27 +96,30 @@ Operating System Utilities | |||
| 95 | 96 | ||
| 96 | 97 | .. c:function:: int PyOS_CheckStack() | |
| 97 | 98 | ||
| 99 | + .. index:: single: USE_STACKCHECK (C macro) | ||
| 100 | + | ||
| 98 | 101 | Return true when the interpreter runs out of stack space. This is a reliable | |
| 99 | - check, but is only available when :c:macro:`USE_STACKCHECK` is defined (currently | ||
| 102 | + check, but is only available when :c:macro:`!USE_STACKCHECK` is defined (currently | ||
| 100 | 103 | on certain versions of Windows using the Microsoft Visual C++ compiler). | |
| 101 | - :c:macro:`USE_STACKCHECK` will be defined automatically; you should never | ||
| 104 | + :c:macro:`!USE_STACKCHECK` will be defined automatically; you should never | ||
| 102 | 105 | change the definition in your own code. | |
| 103 | 106 | ||
| 104 | 107 | ||
| 108 | + .. c:type:: void (*PyOS_sighandler_t)(int) | ||
| 109 | + | ||
| 110 | + | ||
| 105 | 111 | .. c:function:: PyOS_sighandler_t PyOS_getsig(int i) | |
| 106 | 112 | ||
| 107 | 113 | Return the current signal handler for signal *i*. This is a thin wrapper around | |
| 108 | 114 | either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those functions | |
| 109 | - directly! :c:type:`PyOS_sighandler_t` is a typedef alias for :c:expr:`void | ||
| 110 | - (\*)(int)`. | ||
| 115 | + directly! | ||
| 111 | 116 | ||
| 112 | 117 | ||
| 113 | 118 | .. c:function:: PyOS_sighandler_t PyOS_setsig(int i, PyOS_sighandler_t h) | |
| 114 | 119 | ||
| 115 | 120 | Set the signal handler for signal *i* to be *h*; return the old signal handler. | |
| 116 | 121 | This is a thin wrapper around either :c:func:`!sigaction` or :c:func:`!signal`. Do | |
| 117 | - not call those functions directly! :c:type:`PyOS_sighandler_t` is a typedef | ||
| 118 | - alias for :c:expr:`void (\*)(int)`. | ||
| 122 | + not call those functions directly! | ||
| 119 | 123 | ||
| 120 | 124 | .. c:function:: wchar_t* Py_DecodeLocale(const char* arg, size_t *size) | |
| 121 | 125 | ||
@@ -378,10 +382,8 @@ accessible to C code. They all work with the current interpreter thread's | |||
| 378 | 382 | silently abort the operation by raising an error subclassed from | |
| 379 | 383 | :class:`Exception` (other errors will not be silenced). | |
| 380 | 384 | ||
| 381 | - The hook function is of type :c:expr:`int (*)(const char *event, PyObject | ||
| 382 | - *args, void *userData)`, where *args* is guaranteed to be a | ||
| 383 | - :c:type:`PyTupleObject`. The hook function is always called with the GIL | ||
| 384 | - held by the Python interpreter that raised the event. | ||
| 385 | + The hook function is always called with the GIL held by the Python | ||
| 386 | + interpreter that raised the event. | ||
| 385 | 387 | ||
| 386 | 388 | See :pep:`578` for a detailed description of auditing. Functions in the | |
| 387 | 389 | runtime and standard library that raise events are listed in the | |
@@ -390,12 +392,20 @@ accessible to C code. They all work with the current interpreter thread's | |||
| 390 | 392 | ||
| 391 | 393 | .. audit-event:: sys.addaudithook "" c.PySys_AddAuditHook | |
| 392 | 394 | ||
| 393 | - If the interpreter is initialized, this function raises a auditing event | ||
| 395 | + If the interpreter is initialized, this function raises an auditing event | ||
| 394 | 396 | ``sys.addaudithook`` with no arguments. If any existing hooks raise an | |
| 395 | 397 | exception derived from :class:`Exception`, the new hook will not be | |
| 396 | 398 | added and the exception is cleared. As a result, callers cannot assume | |
| 397 | 399 | that their hook has been added unless they control all existing hooks. | |
| 398 | 400 | ||
| 401 | + .. c:namespace:: NULL | ||
| 402 | + .. c:type:: int (*Py_AuditHookFunction) (const char *event, PyObject *args, void *userData) | ||
| 403 | + | ||
| 404 | + The type of the hook function. | ||
| 405 | + *event* is the C string event argument passed to :c:func:`PySys_Audit`. | ||
| 406 | + *args* is guaranteed to be a :c:type:`PyTupleObject`. | ||
| 407 | + *userData* is the argument passed to PySys_AddAuditHook(). | ||
| 408 | + | ||
| 399 | 409 | .. versionadded:: 3.8 | |
| 400 | 410 | ||
| 401 | 411 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,6 @@ | |||
| 3 | 3 | # Keep lines sorted lexicographically to help avoid merge conflicts. | |
| 4 | 4 | ||
| 5 | 5 | Doc/c-api/descriptor.rst | |
| 6 | - Doc/c-api/exceptions.rst | ||
| 7 | 6 | Doc/c-api/float.rst | |
| 8 | 7 | Doc/c-api/gcsupport.rst | |
| 9 | 8 | Doc/c-api/init.rst | |
@@ -12,7 +11,6 @@ Doc/c-api/intro.rst | |||
| 12 | 11 | Doc/c-api/module.rst | |
| 13 | 12 | Doc/c-api/stable.rst | |
| 14 | 13 | Doc/c-api/structures.rst | |
| 15 | - Doc/c-api/sys.rst | ||
| 16 | 14 | Doc/c-api/type.rst | |
| 17 | 15 | Doc/c-api/typeobj.rst | |
| 18 | 16 | Doc/extending/extending.rst | |
| Back | FazBrowse Home | New Git URL |
0 commit comments