Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not round cache mtimes #4128

Merged
merged 4 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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