From dcf8ec2041c2f6e170a962f5d81febe17920b263 Mon Sep 17 00:00:00 2001 From: A-transformer Date: Thu, 6 Mar 2025 20:34:59 +0400 Subject: [PATCH] add assert exists(src_dir) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using assert, the condition os.path.exists(src_dir) is evaluated. If it’s False, the assertion fails, and an AssertionError is raised with the specified message. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index b39efd0..401e058 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,7 @@ class CustomBuildPy(build_py): for d in third_party_include_dirs: dirname = d.split('/')[-1] src_dir = os.path.join(current_dir, d) + assert os.path.exists(src_dir), f"Source directory {src_dir} does not exist." dst_dir = os.path.join(build_include_dir, dirname) # Remove existing directory if it exists