From cc311ace71be1ad7c35b95663190b0f00f14d38f Mon Sep 17 00:00:00 2001 From: awwaawwa <8493196+awwaawwa@users.noreply.github.com> Date: Mon, 3 Mar 2025 06:44:48 +0800 Subject: [PATCH] fix: Add check for babeldoc/const.py existence --- babeldoc/const.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/babeldoc/const.py b/babeldoc/const.py index 84bc173..0adb68b 100644 --- a/babeldoc/const.py +++ b/babeldoc/const.py @@ -20,7 +20,8 @@ def get_cache_file_path(filename: str, sub_folder: str | None = None) -> Path: git_path = shutil.which("git") if git_path is None: raise FileNotFoundError("git executable not found") - + if not (Path(__file__).resolve().parent / "babeldoc" / "const.py").exists(): + raise FileNotFoundError("babeldoc/const.py not found") WATERMARK_VERSION = ( subprocess.check_output( # noqa: S603 [git_path, "describe", "--always"],