From 539d9cf53705467292da6cd84a44cecc56ed75b4 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 20 Nov 2023 20:01:04 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BC=98=E5=8C=96=E8=B1=86=E7=93=A3?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frozen.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frozen.spec b/frozen.spec index ae88afc2..14259fc5 100644 --- a/frozen.spec +++ b/frozen.spec @@ -19,6 +19,8 @@ def collect_pkg_data(package: str, include_py_files: bool = False, subdir: str = pkg_path = Path(pkg_dir) # Walk through all file in the given package, looking for data files. data_toc = TOC() + if not pkg_path.exists(): + return data_toc for file in pkg_path.rglob('*'): if file.is_file(): extension = file.suffix @@ -37,6 +39,8 @@ def collect_local_submodules(package: str): package_dir = Path(package.replace('.', os.sep)) submodules = [package] # Walk through all file in the given package, looking for data files. + if not package_dir.exists(): + return [] for file in package_dir.rglob('*.py'): if file.name == '__init__.py': module = f"{file.parent}".replace(os.sep, '.')