Skip to content

Commit

Permalink
Fix crash with --cache-fine-grained --cache-dir=/dev/null (#18457)
Browse files Browse the repository at this point in the history
Fixes #18454

Couldn't easily repro in test suite
  • Loading branch information
hauntsaninja authored Jan 13, 2025
1 parent 9be49b3 commit d7ebe2e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,8 +973,10 @@ def write_deps_cache(
if st.source_hash:
hash = st.source_hash
else:
assert st.meta, "Module must be either parsed or cached"
hash = st.meta.hash
if st.meta:
hash = st.meta.hash
else:
hash = ""
meta_snapshot[id] = hash

meta = {"snapshot": meta_snapshot, "deps_meta": fg_deps_meta}
Expand Down

0 comments on commit d7ebe2e

Please sign in to comment.