diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index c492451148341d..27eb15facd21bc 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1579,7 +1579,10 @@ way is to instantiate :py:class:`CDLL` or one of its subclasses: :mod:`!ctypes` maintains a thread-local copy of the system's :data:`errno` variable; if you call foreign functions created with ``use_errno=True`` then the :data:`errno` value before the function call is swapped with the ctypes private - copy, the same happens immediately after the function call. + copy, the same happens immediately after the function call. This mechanism only + works for libraries that use the same C runtime library as the interpreter itself. + A library linked against a different C runtime (for example, a different CRT on + Windows) has its own :data:`errno`, which :mod:`!ctypes` cannot observe. The function :func:`ctypes.get_errno` returns the value of the ctypes private copy, and the function :func:`ctypes.set_errno` changes the ctypes private copy