Skip to content

Commit dc8c569

Browse files
authored
treat | as Union (#1218)
1 parent 9cbc777 commit dc8c569

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pcweb/pages/docs/component.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import inspect
44
import os
55
import re
6+
from types import UnionType
67
from typing import (
78
Any,
89
Type,
@@ -453,7 +454,7 @@ def prop_docs(
453454
MAX_PROP_VALUES = 2
454455

455456
COMMON_TYPES = {} # Used to exclude common types from the MAX_PROP_VALUES
456-
if origin is Union:
457+
if origin in (Union, UnionType):
457458
non_literal_types = [] # List for all the non-literal types
458459

459460
for arg in args:

0 commit comments

Comments
 (0)