Skip to content

Commit

Permalink
[daemon] Don't do updates of builtins modules (#8777)
Browse files Browse the repository at this point in the history
We hit a bug internally involving this. I'm going to put a bit more
effort into tracking those in case they are more general, but in
general, nothing good can come of it, I think.
  • Loading branch information
msullivan committed May 5, 2020
1 parent d9f470b commit 77e6b19
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mypy/server/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@
from mypy.server.astdiff import (
snapshot_symbol_table, compare_symbol_table_snapshots, SnapshotItem
)
from mypy.semanal_main import semantic_analysis_for_scc, semantic_analysis_for_targets
from mypy.semanal_main import (
semantic_analysis_for_scc, semantic_analysis_for_targets, core_modules
)
from mypy.server.astmerge import merge_asts
from mypy.server.aststrip import strip_target, SavedAttributes
from mypy.server.deps import get_dependencies_of_target, merge_dependencies
Expand All @@ -148,6 +150,8 @@

MAX_ITER = 1000 # type: Final

SENSITIVE_INTERNAL_MODULES = tuple(core_modules) + ("mypy_extensions", "typing_extensions")


class FineGrainedBuildManager:
def __init__(self, result: BuildResult) -> None:
Expand Down Expand Up @@ -342,6 +346,12 @@ def update_module(self,
self.manager.log_fine_grained('--- update single %r ---' % module)
self.updated_modules.append(module)

# builtins and friends could potentially get triggered because
# of protocol stuff, but nothing good could possibly come from
# actually updating them.
if module in SENSITIVE_INTERNAL_MODULES:
return [], (module, path), None

manager = self.manager
previous_modules = self.previous_modules
graph = self.graph
Expand Down

0 comments on commit 77e6b19

Please sign in to comment.