Skip to content

Commit

Permalink
fix: properly parse packages interpreted as a MultiplexedPath
Browse files Browse the repository at this point in the history
  • Loading branch information
RaczeQ authored Jan 20, 2023
1 parent 2079805 commit eff6baf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions licensecheck/packageinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,15 @@ def getModuleSize(path: Path, name: str) -> int:
Returns:
int: size in bytes
"""
size = sum(
f.stat().st_size for f in path.glob("**/*") if f.is_file() and "__pycache__" not in str(f)
)
size = 0
try:
size = sum(
f.stat().st_size
for f in path.glob("**/*")
if f.is_file() and "__pycache__" not in str(f)
)
except AttributeError:
pass
if size > 0:
return size
request = requests.get(f"https://pypi.org/pypi/{name}/json", timeout=60)
Expand Down

0 comments on commit eff6baf

Please sign in to comment.