[stubsabot] Improve error message (#12273)

Cf. #12272
This commit is contained in:
Sebastian Rittau
2024-07-04 11:01:57 +02:00
committed by GitHub
parent 64d07ae128
commit 311612ed38

View File

@@ -230,7 +230,9 @@ async def release_contains_py_typed(release_to_download: PypiReleaseDownload, *,
with zipfile.ZipFile(body) as zf:
return all_py_files_in_source_are_in_py_typed_dirs(zf)
elif packagetype == "sdist":
assert release_to_download.filename.endswith(".tar.gz")
assert release_to_download.filename.endswith(
".tar.gz"
), f"Package file {release_to_download.filename!r} does not end with '.tar.gz'"
with tarfile.open(fileobj=body, mode="r:gz") as zf:
return all_py_files_in_source_are_in_py_typed_dirs(zf)
else: