Skip to content

Commit b6bcdc0

Browse files
grafi-ttgvanrossum
authored andcommitted
Search lib directory suffixed by ABI (32 or 64), used in e.g. Gentoo Linux (#3211) (#3758)
1 parent 2589b1b commit b6bcdc0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mypy/build.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,14 @@ def default_data_dir(bin_dir: Optional[str]) -> str:
219219
# Installed in site-packages or dist-packages, but invoked with python3 -m mypy;
220220
# __file__ is .../blah/lib/python3.N/site-packages/mypy/build.py
221221
# or .../blah/lib/python3.N/dist-packages/mypy/build.py (Debian)
222+
# or .../blah/lib64/python3.N/dist-packages/mypy/build.py (Gentoo)
222223
# or .../blah/lib/site-packages/mypy/build.py (Windows)
223224
# blah may be a virtualenv or /usr/local. We want .../blah/lib/mypy.
224225
lib = parent
225226
for i in range(2):
226227
lib = os.path.dirname(lib)
227-
if os.path.basename(lib) == 'lib':
228-
return os.path.join(lib, 'mypy')
228+
if os.path.basename(lib) in ('lib', 'lib32', 'lib64'):
229+
return os.path.join(os.path.dirname(lib), 'lib/mypy')
229230
subdir = os.path.join(parent, 'lib', 'mypy')
230231
if os.path.isdir(subdir):
231232
# If installed via buildout, the __file__ is

0 commit comments

Comments
 (0)