From e1b4649fafcfc0881367e8069f66359e3bfbc5eb Mon Sep 17 00:00:00 2001 From: Samson <16504129+sagudev@users.noreply.github.com> Date: Fri, 17 Jan 2025 07:28:14 +0100 Subject: [PATCH] Fix check for unused subdir in wpt import script (#35036) Before we appended all subdirs of unused_dir to unused_dirs, which caused errors on removing because root dir was already removed. Fix #35026, tested locally. Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com> --- python/wpt/update.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/wpt/update.py b/python/wpt/update.py index 42c424eb9e2..96efa483a7f 100644 --- a/python/wpt/update.py +++ b/python/wpt/update.py @@ -60,9 +60,7 @@ def remove_unused_metadata(): for meta_root in META_ROOTS: for base_dir, dir_names, files in os.walk(meta_root): # Skip recursing into any directories that were previously found to be missing. - if base_dir in unused_dirs: - # Skip processing any subdirectories of known missing directories. - unused_dirs += [os.path.join(base_dir, x) for x in dir_names] + if any([os.path.commonpath([base_dir, unused_dir]) == unused_dir for unused_dir in unused_dirs]): continue for dir_name in dir_names: