diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-09-20 09:34:11 -0500 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-09-20 09:36:09 -0500 |
commit | fdc6ffd264d015d4f6ba22488a4e7ab78d365b24 (patch) | |
tree | 69dc5133c23c8e72bb849e6c9f277f65bca92dc7 /modules | |
parent | 2be730a05b7ff221b89c967981f7caee6e164ef0 (diff) | |
download | redot-engine-fdc6ffd264d015d4f6ba22488a4e7ab78d365b24.tar.gz |
Style: Update `ruff` & `mypy` to latest versions
Diffstat (limited to 'modules')
-rw-r--r-- | modules/raycast/godot_update_embree.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/raycast/godot_update_embree.py b/modules/raycast/godot_update_embree.py index c179060365..c4fff330c9 100644 --- a/modules/raycast/godot_update_embree.py +++ b/modules/raycast/godot_update_embree.py @@ -4,8 +4,8 @@ import re import shutil import stat import subprocess -from types import TracebackType -from typing import Any, Callable, Tuple, Type +import sys +from typing import Any, Callable git_tag = "v4.3.1" @@ -100,9 +100,7 @@ subprocess.run(["git", "checkout", git_tag]) commit_hash = str(subprocess.check_output(["git", "rev-parse", "HEAD"], universal_newlines=True)).strip() -def on_rm_error( - function: Callable[..., Any], path: str, excinfo: Tuple[Type[Exception], Exception, TracebackType] -) -> None: +def on_rm_error(function: Callable[..., Any], path: str, excinfo: Exception) -> None: """ Error handler for `shutil.rmtree()`. @@ -113,10 +111,12 @@ def on_rm_error( os.unlink(path) -# 3.12 Python and beyond should replace `onerror` with `onexc`. # We remove the .git directory because it contains # a lot of read-only files that are problematic on Windows. -shutil.rmtree(".git", onerror=on_rm_error) +if sys.version_info >= (3, 12): + shutil.rmtree(".git", onexc=on_rm_error) +else: + shutil.rmtree(".git", onerror=on_rm_error) # type: ignore all_files = set(cpp_files) |