Skip to content

Commit a324731

Browse files
committed
- 优化豆瓣详情展示
1 parent 539d9cf commit a324731

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

frozen.spec

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@ def collect_pkg_data(package: str, include_py_files: bool = False, subdir: str =
88
from PyInstaller.utils.hooks import get_package_paths, PY_IGNORE_EXTENSIONS
99
from PyInstaller.building.datastruct import TOC
1010

11+
data_toc = TOC()
12+
1113
# Accept only strings as packages.
1214
if type(package) is not str:
1315
raise ValueError
14-
15-
pkg_base, pkg_dir = get_package_paths(package)
16+
try:
17+
pkg_base, pkg_dir = get_package_paths(package)
18+
except ValueError:
19+
return data_toc
1620
if subdir:
1721
pkg_path = Path(pkg_dir) / subdir
1822
else:
1923
pkg_path = Path(pkg_dir)
2024
# Walk through all file in the given package, looking for data files.
21-
data_toc = TOC()
2225
if not pkg_path.exists():
2326
return data_toc
2427
for file in pkg_path.rglob('*'):

0 commit comments

Comments
 (0)