From a324731061b9a1cb400091877ec23b8d29862018 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 20 Nov 2023 20:06:25 +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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frozen.spec b/frozen.spec index 14259fc5..a1b070fc 100644 --- a/frozen.spec +++ b/frozen.spec @@ -8,17 +8,20 @@ def collect_pkg_data(package: str, include_py_files: bool = False, subdir: str = from PyInstaller.utils.hooks import get_package_paths, PY_IGNORE_EXTENSIONS from PyInstaller.building.datastruct import TOC + data_toc = TOC() + # Accept only strings as packages. if type(package) is not str: raise ValueError - - pkg_base, pkg_dir = get_package_paths(package) + try: + pkg_base, pkg_dir = get_package_paths(package) + except ValueError: + return data_toc if subdir: pkg_path = Path(pkg_dir) / subdir else: 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('*'):