]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix `ctypes` typo in `set_exception` (#101040)
authorCristián Maureira-Fredes <cmaureir@users.noreply.github.com>
Sun, 15 Jan 2023 15:12:37 +0000 (16:12 +0100)
committerGitHub <noreply@github.com>
Sun, 15 Jan 2023 15:12:37 +0000 (20:42 +0530)
Doc/library/ctypes.rst
Modules/_ctypes/callproc.c

index ac533a939d6ac2328f3aae5e964c4eca5d1d3d88..50ab2937562355224a9e4157b622645b19f15206 100644 (file)
@@ -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
index 1958758dd0cf0b68d2d62305d08319fcc2030742..f6d98bbeebc24e94460472d88a348e6aab959ddb 100644 (file)
@@ -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;
     }