From bd23125ae9c87074c135b51e6162b75b173c6c1d Mon Sep 17 00:00:00 2001 From: Vytautas Astrauskas Date: Mon, 29 Feb 2016 14:12:16 +0100 Subject: [PATCH] An attempt to fix data path search for installation via zc.buildout. --- mypy/build.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mypy/build.py b/mypy/build.py index fb5d85813f45..12b166006e08 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -223,6 +223,12 @@ def default_data_dir(bin_dir: str) -> str: lib = os.path.dirname(os.path.dirname(parent)) if os.path.basename(lib) == 'lib': return os.path.join(lib, 'mypy') + subdir = os.path.join(parent, 'lib', 'mypy') + if os.path.isdir(subdir): + # If installed via buildout, the __file__ is + # somewhere/mypy/__init__.py and what we want is + # somewhere/lib/mypy. + return subdir # Default to directory containing this file's parent. return parent base = os.path.basename(bin_dir)