diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py index 2b01506f3d4ffa..a37575e5f012ae 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py @@ -532,7 +532,7 @@ def test(): from ctypes import cdll if os.name == "nt": print(cdll.msvcrt) - print(cdll.load("msvcrt")) + print(cdll.LoadLibrary("msvcrt")) print(find_library("msvcrt")) if os.name == "posix": diff --git a/Misc/NEWS.d/next/Library/2026-09-19-11-40-12.gh-issue-157763.Kq3vBd.rst b/Misc/NEWS.d/next/Library/2026-09-19-11-40-12.gh-issue-157763.Kq3vBd.rst new file mode 100644 index 00000000000000..bfbabdde3b649a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-09-19-11-40-12.gh-issue-157763.Kq3vBd.rst @@ -0,0 +1,2 @@ +``ctypes.util.test()`` now calls ``cdll.LoadLibrary()`` on Windows instead of +the nonexistent ``cdll.load()``.