Skip to content

Conversation

@aisk
Copy link
Contributor

@aisk aisk commented Jul 18, 2025

This function is actually testing get_last_error() instead of GetLastError(), which is also a valid Windows API but have different behaviors. Although this is not really a problem, I think it's better to make the test code clearer.

@aisk
Copy link
Contributor Author

aisk commented Jul 18, 2025

Sorry, I read the document in ctypes module again:

The use_last_error parameter, when set to true, enables the same mechanism for the Windows error code which is managed by the GetLastError() and SetLastError() Windows API functions; ctypes.get_last_error() and ctypes.set_last_error() are used to request and change the ctypes private copy of the windows error code.

And found that the ctypes.get_last_error() just wrappers around Windows API GetLastError, so the test name is correct.

@aisk aisk closed this Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant