diff --git a/charmhub_lp_tools/charm_project.py b/charmhub_lp_tools/charm_project.py index 4fa9835..6bdeefb 100644 --- a/charmhub_lp_tools/charm_project.py +++ b/charmhub_lp_tools/charm_project.py @@ -19,7 +19,8 @@ import logging import subprocess import tempfile -from typing import (Any, Dict, Generator, List, Tuple, IO, Optional, Set) +from typing import (Any, Dict, Generator, List, Tuple, IO, Optional, Set, + Union) import sys import time import yaml @@ -1863,7 +1864,7 @@ def copy_revisions(self, CharmChannel.str_revisions_by_arch(destination_arch_revisions)) # don't duplicate releases to the same channel. - revision_pairs: Set[Tuple[int, int | None]] = set() + revision_pairs: Set[Tuple[int, Union[int, None]]] = set() for arch, revision in arch_revisions.items(): dest_revision = destination_arch_revisions.get(arch) if (revision, dest_revision) in revision_pairs: diff --git a/charmhub_lp_tools/revisions.py b/charmhub_lp_tools/revisions.py index a5486f3..847c25d 100644 --- a/charmhub_lp_tools/revisions.py +++ b/charmhub_lp_tools/revisions.py @@ -24,6 +24,7 @@ Dict, List, Set, + Union, ) from prettytable import PrettyTable @@ -94,8 +95,8 @@ def setup_parser( def get_revisions(channel: CharmChannel, - args_bases: List[str] | None, - args_arches: List[str] | None + args_bases: Union[List[str], None], + args_arches: Union[List[str], None], ) -> Dict[str, Dict[str, List[int]]]: """Get the revisions by base -> arch -> [revisions].