diff --git a/mypy/modulefinder.py b/mypy/modulefinder.py index 55d226cb647ae..3ca1a8db1c308 100644 --- a/mypy/modulefinder.py +++ b/mypy/modulefinder.py @@ -448,7 +448,7 @@ def default_lib_path(data_dir: str, @functools.lru_cache(maxsize=None) -def get_site_packages_dirs(python_executable: Optional[str]) -> Tuple[List[str], List[str]]: +def get_site_packages_dirs(python_executable: str) -> Tuple[List[str], List[str]]: """Find package directories for given python. This runs a subprocess call, which generates a list of the egg directories, and the site @@ -461,8 +461,6 @@ def make_abspath(path: str, root: str) -> str: else: return os.path.join(root, os.path.normpath(path)) - if python_executable is None: - return [], [] if python_executable == sys.executable: # Use running Python's package dirs site_packages = sitepkgs.getsitepackages() @@ -543,7 +541,11 @@ def compute_search_paths(sources: List[BuildSource], if alt_lib_path: mypypath.insert(0, alt_lib_path) - egg_dirs, site_packages = get_site_packages_dirs(options.python_executable) + if options.python_executable is None: + egg_dirs = [] # type: List[str] + site_packages = [] # type: List[str] + else: + egg_dirs, site_packages = get_site_packages_dirs(options.python_executable) for site_dir in site_packages: assert site_dir not in lib_path if (site_dir in mypypath or diff --git a/mypy/typeshed b/mypy/typeshed index e199c2e4bc95c..df6136c4ac0bd 160000 --- a/mypy/typeshed +++ b/mypy/typeshed @@ -1 +1 @@ -Subproject commit e199c2e4bc95c4df25f0270cedbee934083f4ae8 +Subproject commit df6136c4ac0bd0751699a7eeeff36e7486a90254 diff --git a/mypyc/analysis.py b/mypyc/analysis.py index a766b0dee9b82..b71e120dceea8 100644 --- a/mypyc/analysis.py +++ b/mypyc/analysis.py @@ -30,7 +30,7 @@ def __init__(self, def __str__(self) -> str: lines = [] - lines.append('exits: %s' % sorted(self.exits)) + lines.append('exits: %s' % sorted(self.exits, key=lambda e: e.label)) lines.append('succ: %s' % self.succ) lines.append('pred: %s' % self.pred) return '\n'.join(lines)