Skip to content

Commit

Permalink
allow cache metadata to point to directory
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Nov 12, 2020
1 parent 63a93f1 commit 5275932
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 @@ -1303,8 +1303,10 @@ def validate_meta(meta: Optional[CacheMeta], id: str, path: Optional[str],
st = manager.get_stat(path)
except OSError:
return None
if not stat.S_ISREG(st.st_mode):
manager.log('Metadata abandoned for {}: file {} does not exist'.format(id, path))
if not stat.S_ISDIR(st.st_mode) and not stat.S_ISREG(st.st_mode):
manager.log(
'Metadata abandoned for {}: file or directory {} does not exist'.format(id, path)
)
return None

manager.add_stats(validate_stat_time=time.time() - t0)
Expand Down

0 comments on commit 5275932

Please sign in to comment.