Skip to content

Commit

Permalink
Switch typing '|' to Union
Browse files Browse the repository at this point in the history
Py3.9 and before doesn't understand the "type | type" form.
  • Loading branch information
ajkavanagh committed Nov 23, 2023
1 parent d00fa14 commit a819f2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions charmhub_lp_tools/charm_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions charmhub_lp_tools/revisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Dict,
List,
Set,
Union,
)

from prettytable import PrettyTable
Expand Down Expand Up @@ -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].
Expand Down

0 comments on commit a819f2c

Please sign in to comment.