Ignoring errors is the default behavior for os.walk

This commit is contained in:
Kovid Goyal
2026-01-31 08:28:10 +05:30
parent 0a01f41996
commit 524fe6ae3b

View File

@@ -932,7 +932,7 @@ def add_builtin_fonts(args: Options) -> None:
break break
else: else:
for candidate in candidates: for candidate in candidates:
for root, _, files in os.walk(candidate, onerror=lambda _: None): for root, _, files in os.walk(candidate):
if filename in files: if filename in files:
font_file = os.path.join(root, filename) font_file = os.path.join(root, filename)
break break