Skip to content

Commit

Permalink
Make version hack more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Apr 8, 2022
1 parent 7895a86 commit 846cf53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pip/_internal/metadata/importlib/_compat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import importlib.metadata
from typing import Optional, Protocol
from typing import Any, Optional, Protocol, cast


class BasePath(Protocol):
Expand Down Expand Up @@ -38,4 +38,4 @@ def get_dist_name(dist: importlib.metadata.Distribution) -> str:
The ``name`` attribute is only available in Python 3.10 or later. We are
targeting exactly that, but Mypy does not know this.
"""
return dist.name # type: ignore[attr-defined]
return cast(Any, dist).name

0 comments on commit 846cf53

Please sign in to comment.