diff --git a/build_files/utils/make_utils.py b/build_files/utils/make_utils.py index 697989f9a4e..25f67f6b2e9 100755 --- a/build_files/utils/make_utils.py +++ b/build_files/utils/make_utils.py @@ -23,7 +23,14 @@ import subprocess import sys from pathlib import Path +from types import ( + TracebackType, +) +from typing import ( + Any, +) from collections.abc import ( + Callable, Sequence, ) @@ -285,9 +292,12 @@ def remove_directory(directory: Path) -> None: Takes care of clearing read-only attributes which might prevent deletion on Windows. """ - - def remove_readonly(func, path, _): - "Clear the readonly bit and reattempt the removal" + def remove_readonly( + func: Callable[..., Any], + path: str, + _: tuple[type[BaseException], BaseException, TracebackType], + ) -> None: + "Clear the read-only bit and reattempt the removal." os.chmod(path, stat.S_IWRITE) func(path)