Skip to content

Commit c5502b1

Browse files
committed
Consider all installations paths for exclusion
1 parent 7b56339 commit c5502b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/charonload/_config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import re
88
import site
99
import sys
10+
import sysconfig
1011
import tempfile
1112
from dataclasses import dataclass
1213
from 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

0 commit comments

Comments
 (0)