- 优化豆瓣详情展示

This commit is contained in:
jxxghp
2023-11-20 20:06:25 +08:00
parent 539d9cf537
commit a324731061

View File

@ -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('*'):