Skip to content

Commit 5275932

Browse files
author
hauntsaninja
committed
allow cache metadata to point to directory
1 parent 63a93f1 commit 5275932

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mypy/build.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1303,8 +1303,10 @@ def validate_meta(meta: Optional[CacheMeta], id: str, path: Optional[str],
13031303
st = manager.get_stat(path)
13041304
except OSError:
13051305
return None
1306-
if not stat.S_ISREG(st.st_mode):
1307-
manager.log('Metadata abandoned for {}: file {} does not exist'.format(id, path))
1306+
if not stat.S_ISDIR(st.st_mode) and not stat.S_ISREG(st.st_mode):
1307+
manager.log(
1308+
'Metadata abandoned for {}: file or directory {} does not exist'.format(id, path)
1309+
)
13081310
return None
13091311

13101312
manager.add_stats(validate_stat_time=time.time() - t0)

0 commit comments

Comments
 (0)