Skip to content

Fix return type of win32wnet.WNetOpenEnum #13890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2025

Conversation

petamas
Copy link
Contributor

@petamas petamas commented Apr 26, 2025

win32wnet.WNetOpenEnum returns a PyHANDLE, not an int.

See @Avasam's comment here:

>>> import win32wnet
>>> handle = win32wnet.WNetOpenEnum(RESOURCE_REMEMBERED, RESOURCETYPE_DISK, 0, None)
>>> handle
<PyNetEnumHANDLE:2352947023664>

The wrong typehint makes the otherwise valid combination of WNetOpenEnum() and WNetEnumResource() fail mypy's checking.

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@Avasam Avasam requested review from Avasam and removed request for Avasam April 27, 2025 04:55
@Avasam Avasam merged commit 1ccaa7f into python:main Apr 27, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants