Skip to content

Commit

Permalink
dont apply pep604 in python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
zunda-arrow committed Sep 8, 2022
1 parent 7a6661d commit 6355389
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sigparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def _apply_PEP604() -> None:
Allow writing union types as X | Y
"""

if sys.version_info >= (3, 10):
return

def _union_or(left: typing.Any, right: typing.Any) -> typing.Any:
return typing.Union[left, right]

Expand All @@ -48,6 +51,9 @@ def _union_or(left: typing.Any, right: typing.Any) -> typing.Any:
forbiddenfruit.curse(type, "__or__", _union_or)

def _revert_PEP604() -> None:
if sys.version_info >= (3, 10):
return

forbiddenfruit.reverse(type, "__or__")

GLOBAL_PEP604 = False
Expand Down

0 comments on commit 6355389

Please sign in to comment.