Do not round cache mtimes (#4128)

Fixes #4116

This logic was introduced in #3821, I believe as a result of copying
logic inside mypy that I think isn't relevant to Black
This commit is contained in:
Shantanu 2023-12-27 22:24:57 -08:00 committed by GitHub
parent c80685f361
commit bf6cabc804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,8 @@
<!-- Changes to how Black can be configured -->
- Fix cache mtime logic that resulted in false positive cache hits (#4128)
### Packaging
<!-- Changes to how Black is packaged, such as dependency requirements -->

View File

@ -101,7 +101,7 @@ def is_changed(self, source: Path) -> bool:
st = res_src.stat()
if st.st_size != old.st_size:
return True
if int(st.st_mtime) != int(old.st_mtime):
if st.st_mtime != old.st_mtime:
new_hash = Cache.hash_digest(res_src)
if new_hash != old.hash:
return True