Skip to content

Commit

Permalink
Use Optional instead of union operation
Browse files Browse the repository at this point in the history
The `foo|None` is the preferred way of doing this since Python 3.10 but RHEL9
still runs Python 3.9 and therefore we need to use `Optional` to preserve
backward compatibility.
  • Loading branch information
FrostyX committed Oct 7, 2024
1 parent 8ef62db commit 3fba2e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fedora_distro_aliases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import requests
from typing import Optional
from munch import Munch
from fedora_distro_aliases.cache import Cache, SaveLoad

Expand Down Expand Up @@ -35,7 +36,7 @@ def bodhi_active_releases():
return releases


def get_distro_aliases(cache : SaveLoad|None = None):
def get_distro_aliases(cache: Optional[SaveLoad] = None):
"""
Define distribution aliases like `fedora-stable`, `fedora-branched`,
`epel-all`, and more.
Expand Down

0 comments on commit 3fba2e1

Please sign in to comment.