Skip to content

Commit 888aa41

Browse files
fix: TypeErr on python3.9
unsupported operand type(s) for |: '_UnionGenericAlias' and 'types.GenericAlias'
1 parent e456707 commit 888aa41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypyc/irbuild/expression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import math
1010
from collections.abc import Sequence
1111
from functools import partial
12-
from typing import Callable
12+
from typing import Callable, Union
1313

1414
from mypy.nodes import (
1515
ARG_NAMED,
@@ -116,7 +116,7 @@
116116
from mypyc.primitives.str_ops import str_slice_op
117117
from mypyc.primitives.tuple_ops import list_tuple_op, tuple_slice_op
118118

119-
ConstantValueTuple = ConstantValue | tuple["ConstantValueTuple", ...]
119+
ConstantValueTuple = Union[ConstantValue, tuple["ConstantValueTuple", ...]]
120120

121121
# Name and attribute references
122122

0 commit comments

Comments
 (0)