Initialize deque with path string (#48734)

This commit is contained in:
Tara Drwenski 2025-01-27 09:42:29 -07:00 committed by GitHub
parent b8e448afa0
commit cc9e0137df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1472,7 +1472,7 @@ def set_executable(path):
def recursive_mtime_greater_than(path: str, time: float) -> bool:
"""Returns true if any file or dir recursively under `path` has mtime greater than `time`."""
# use bfs order to increase likelihood of early return
queue: Deque[str] = collections.deque(path)
queue: Deque[str] = collections.deque([path])
if os.stat(path).st_mtime > time:
return True