Commit b080641
committed
fix: Expand VersionedUnionType tuple in SchemaUnion definition
Fixes ImportError caused by passing a tuple to Union[]. The previous
commit (e290f46) changed VersionedUnionType from a Union type to a
tuple for isinstance checks, but SchemaUnion was still trying to use
it as a Union argument. This expands the tuple elements individually
for Python 3.10+ (UnionType + _UnionGenericAlias) and Python < 3.10
(_UnionGenericAlias only).
Error: TypeError: Union[arg, ...]: each arg must be a type. Got
(<class 'types.UnionType'>, <class 'typing._UnionGenericAlias'>).1 parent aa57b50 commit b080641
1 file changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4251 | 4251 | | |
4252 | 4252 | | |
4253 | 4253 | | |
4254 | | - | |
4255 | | - | |
4256 | | - | |
| 4254 | + | |
| 4255 | + | |
| 4256 | + | |
| 4257 | + | |
| 4258 | + | |
| 4259 | + | |
| 4260 | + | |
| 4261 | + | |
4257 | 4262 | | |
4258 | 4263 | | |
4259 | 4264 | | |
| |||
0 commit comments