Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #363 from kac-/fix-yt-0
Browse files Browse the repository at this point in the history
fix: util: clear_tmp_folder: exclude invalid symlinks
  • Loading branch information
azlux authored May 30, 2023
2 parents bd9f9bc + 5582d14 commit 6115a0d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ def clear_tmp_folder(path, size):
all_files = ""
for (path, dirs, files) in os.walk(path):
all_files = [os.path.join(path, file) for file in files]
# exclude invalid symlinks (linux)
all_files = [file for file in all_files if os.path.exists(file)]
all_files.sort(key=lambda x: os.path.getmtime(x))
size_tp = 0
for idx, file in enumerate(all_files):
Expand Down

0 comments on commit 6115a0d

Please sign in to comment.