File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 77import re
88import site
99import sys
10+ import sysconfig
1011import tempfile
1112from dataclasses import dataclass
1213from typing import TYPE_CHECKING
@@ -218,8 +219,9 @@ def _find_stubs_directory(
218219 return full_stubs_directory
219220
220221 def _exclude_install_directories (self : Self , directory : pathlib .Path ) -> pathlib .Path | None :
221- install_directories = [site .getusersitepackages ()] if site .ENABLE_USER_SITE else []
222- install_directories .extend (site .getsitepackages ())
222+ install_directories = [site .getuserbase ()] if site .ENABLE_USER_SITE else []
223+ install_directories .extend (sysconfig .get_paths ().values ())
224+ install_directories = list (set (install_directories )) # Remove duplicates
223225
224226 return (
225227 directory
You can’t perform that action at this time.
0 commit comments