Skip to content

Commit

Permalink
Search lib directory suffixed by ABI (32 or 64), used in e.g. Gentoo …
Browse files Browse the repository at this point in the history
…Linux (python#3211)
  • Loading branch information
grafi-tt committed Jul 23, 2017
1 parent 2589b1b commit 3bd775d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,14 @@ def default_data_dir(bin_dir: Optional[str]) -> str:
# Installed in site-packages or dist-packages, but invoked with python3 -m mypy;
# __file__ is .../blah/lib/python3.N/site-packages/mypy/build.py
# or .../blah/lib/python3.N/dist-packages/mypy/build.py (Debian)
# or .../blah/lib64/python3.N/dist-packages/mypy/build.py (Gentoo)
# or .../blah/lib/site-packages/mypy/build.py (Windows)
# blah may be a virtualenv or /usr/local. We want .../blah/lib/mypy.
lib = parent
for i in range(2):
lib = os.path.dirname(lib)
if os.path.basename(lib) == 'lib':
return os.path.join(lib, 'mypy')
if os.path.basename(lib) in ('lib', 'lib32', 'lib64'):
return os.path.join(os.path.dirname(lib), 'lib/mypy')
subdir = os.path.join(parent, 'lib', 'mypy')
if os.path.isdir(subdir):
# If installed via buildout, the __file__ is
Expand Down

0 comments on commit 3bd775d

Please sign in to comment.