Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Sep 18, 2024
1 parent ff85d48 commit 17e7e45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extra_platforms/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@
"""


def _get_macos_codename(major: str, minor: str) -> str:
def _get_macos_codename(major: str | None = None, minor: str | None = None) -> str:
matches = set()
for (major_key, minor_key), codename in _MACOS_CODENAMES.items():
if minor_key is not None and minor_key != minor:
continue
if major_key == major:
matches.add(codename)
if not matches:
raise ValueError(f"No macOS codename match version {major}.{minor}")
raise ValueError(f"No macOS codename match version ({major!r}, {minor!r})")
if len(matches) != 1:
raise ValueError(
f"Version {major}.{minor} match multiple codenames: {matches!r}"
Expand Down

0 comments on commit 17e7e45

Please sign in to comment.