Skip to content

Commit

Permalink
Do not round cache mtimes (#4128)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hauntsaninja authored Dec 28, 2023
1 parent c80685f commit bf6cabc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down
2 changes: 1 addition & 1 deletion src/black/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf6cabc

Please sign in to comment.