Skip to content
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

Changed the import of ctypes.wintypes from __import__ to a regular import statement #4534

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/4534.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changed the import of ``ctypes.wintypes`` from ``__import__`` to a regular ``import`` statement -- by :user:`Avasam`
4 changes: 2 additions & 2 deletions setuptools/windows_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def windows_only(func):


@windows_only
def hide_file(path):
def hide_file(path: str) -> None:
"""
Set the hidden attribute on a file or directory.

Expand All @@ -17,8 +17,8 @@ def hide_file(path):
`path` must be text.
"""
import ctypes
import ctypes.wintypes

__import__('ctypes.wintypes')
SetFileAttributes = ctypes.windll.kernel32.SetFileAttributesW
SetFileAttributes.argtypes = ctypes.wintypes.LPWSTR, ctypes.wintypes.DWORD
SetFileAttributes.restype = ctypes.wintypes.BOOL
Expand Down
Loading