Skip to content

Commit

Permalink
mypy: fix "unused type ignore" issue on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
radoering committed Apr 30, 2022
1 parent 6721ebe commit c7c6817
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/poetry/utils/appdirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ def _get_win_folder_with_ctypes(csidl_name: str) -> str:
}[csidl_name]

buf = ctypes.create_unicode_buffer(1024)
windll = ctypes.windll # type: ignore[attr-defined]
if sys.platform != "win32": # for mypy
return ""
windll = ctypes.windll
windll.shell32.SHGetFolderPathW(None, csidl_const, None, 0, buf)

# Downgrade to short path name if have highbit chars. See
Expand Down

0 comments on commit c7c6817

Please sign in to comment.