8000 Fix `ctypes` typo in `set_exception` (#101040) · python/cpython@5e9df88 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5e9df88

Browse files
authored
Fix ctypes typo in set_exception (#101040)
1 parent f6307d4 commit 5e9df88

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Doc/library/ctypes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,12 +1656,12 @@ They are instances of a private class:
16561656
passed arguments.
16571657

16581658

1659-
.. audit-event:: ctypes.seh_exception code foreign-functions
1659+
.. audit-event:: ctypes.set_exception code foreign-functions
16601660

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

16671667
.. audit-event:: ctypes.call_function func_pointer,arguments foreign-functions

Modules/_ctypes/callproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static WCHAR *FormatError(DWORD code)
286286
#ifndef DONT_USE_SEH
287287
static void SetException(DWORD code, EXCEPTION_RECORD *pr)
288288
{
289-
if (PySys_Audit("ctypes.seh_exception", "I", code) < 0) {
289+
if (PySys_Audit("ctypes.set_exception", "I", code) < 0) {
290290
/* An exception was set by the audit hook */
291291
return;
292292
}

0 commit comments

Comments
 (0)
0