Skip to content

Commit

Permalink
Use Union rather than pipe for type annotation for Python 3.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Nov 13, 2024
1 parent 44d10b4 commit 1e64246
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions glue_ar/registries.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections.abc import Callable
from typing import Tuple, Type
from typing import Tuple, Type, Union

from glue.config import DictRegistry

Expand All @@ -9,14 +9,14 @@

class BuilderRegistry(DictRegistry):

def add(self, extensions: str | Tuple[str], builder: Type):
def add(self, extensions: Union[str, Tuple[str]], builder: Type):
if isinstance(extensions, str):
self._members[extensions] = builder
else:
for ext in extensions:
self._members[ext] = builder

def __call__(self, extensions: str | Tuple[str]):
def __call__(self, extensions: Union[str, Tuple[str]]):
def adder(builder: Type):
self.add(extensions, builder)
return adder
Expand Down

0 comments on commit 1e64246

Please sign in to comment.