From d3e3914a65c0fd5b642c74ccc7d799180b00046c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 31 Jan 2017 09:13:24 -0800 Subject: [PATCH] Fix 2778 -- never skip modules/packages given with -m/-p --- mypy/build.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mypy/build.py b/mypy/build.py index 85d06c8bb069..21ec44d18db9 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -1148,6 +1148,7 @@ def __init__(self, # - skip -> don't analyze, make the type Any follow_imports = self.options.follow_imports if (follow_imports != 'normal' + and caller_state != None # Honor top-level modules and path.endswith('.py') # Stubs are always normal and id != 'builtins' # Builtins is always normal and not (caller_state and @@ -1519,6 +1520,9 @@ def write_cache(self) -> None: def dispatch(sources: List[BuildSource], manager: BuildManager) -> None: manager.log("Mypy version %s" % __version__) graph = load_graph(sources, manager) + if not graph: + print("Nothing to do?!") + return manager.log("Loaded graph with %d nodes" % len(graph)) if manager.options.dump_graph: dump_graph(graph)