From 5e9df888dd5ab0e59d1cebc30c998a17aa65a3e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Sun, 15 Jan 2023 16:12:37 +0100 Subject: Fix `ctypes` typo in `set_exception` (#101040) --- Doc/library/ctypes.rst | 4 ++-- Modules/_ctypes/callproc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index ac533a9..50ab293 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -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 diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 1958758..f6d98bb 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -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; } -- cgit v0.12