Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ctypes typo set_exception #101040

Merged
merged 1 commit into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1656,12 +1656,12 @@ They are instances of a private class:
passed arguments.


.. audit-event:: ctypes.seh_exception code foreign-functions
.. audit-event:: ctypes.set_exception code foreign-functions

On Windows, when a foreign function call raises a system exception (for
example, due to an access violation), it will be captured and replaced with
a suitable Python exception. Further, an auditing event
``ctypes.seh_exception`` with argument ``code`` will be raised, allowing an
``ctypes.set_exception`` with argument ``code`` will be raised, allowing an
audit hook to replace the exception with its own.

.. audit-event:: ctypes.call_function func_pointer,arguments foreign-functions
Expand Down
2 changes: 1 addition & 1 deletion Modules/_ctypes/callproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static WCHAR *FormatError(DWORD code)
#ifndef DONT_USE_SEH
static void SetException(DWORD code, EXCEPTION_RECORD *pr)
{
if (PySys_Audit("ctypes.seh_exception", "I", code) < 0) {
if (PySys_Audit("ctypes.set_exception", "I", code) < 0) {
/* An exception was set by the audit hook */
return;
}
Expand Down