Skip to content

Commit

Permalink
Shut mypy up
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Dec 23, 2024
1 parent b06af45 commit 54a0b6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions repology/parsers/parsers/hackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ def _iter_hackage_tarfile_multipass(path: str) -> Iterable[tuple[str, dict[str,
latest_versions: dict[str, list[Any]] = {} # name -> [version, count]

# Pass 1: gather preferred versions
with tarfile.open(path, 'r|*') as tar:
with tarfile.open(path, 'r|*') as tar: # type: ignore
for tarinfo in tar:
tarpath = tarinfo.name.split('/')
if tarpath[-1] == 'preferred-versions':
preferred_versions[tarpath[0]] = _extract_tarinfo(tar, tarinfo)

# Pass 2: gather latest versions
with tarfile.open(path, 'r|*') as tar:
with tarfile.open(path, 'r|*') as tar: # type: ignore
for tarinfo in tar:
tarpath = tarinfo.name.split('/')
if tarpath[-1].endswith('.cabal'):
Expand All @@ -106,7 +106,7 @@ def _iter_hackage_tarfile_multipass(path: str) -> Iterable[tuple[str, dict[str,
latest_versions[name][1] += 1

# Pass 3: extract cabal files
with tarfile.open(path, 'r|*') as tar:
with tarfile.open(path, 'r|*') as tar: # type: ignore
for tarinfo in tar:
tarpath = tarinfo.name.split('/')
if tarpath[-1].endswith('.cabal'):
Expand Down

0 comments on commit 54a0b6e

Please sign in to comment.