From 3fba2e1d539fefbfdf7bbebfbe04b348a6bc10c9 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Mon, 7 Oct 2024 22:56:22 +0200 Subject: [PATCH] Use Optional instead of union operation 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. --- fedora_distro_aliases/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fedora_distro_aliases/__init__.py b/fedora_distro_aliases/__init__.py index d119965..515285d 100644 --- a/fedora_distro_aliases/__init__.py +++ b/fedora_distro_aliases/__init__.py @@ -5,6 +5,7 @@ """ import requests +from typing import Optional from munch import Munch from fedora_distro_aliases.cache import Cache, SaveLoad @@ -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.