Skip to content

Commit 5645622

Browse files
committed
fix-for-python-3.11
1 parent 0b49ce3 commit 5645622

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

IPython/core/guarded_eval.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,8 @@ def is_type_annotation(obj) -> bool:
577577
return True
578578
if isinstance(obj, types.GenericAlias):
579579
return True
580+
if hasattr(types, "UnionType") and isinstance(obj, types.UnionType):
581+
return True
580582
if type(obj).__name__ in ("_GenericAlias", "_SpecialForm", "_UnionGenericAlias"):
581583
return True
582584

0 commit comments

Comments
 (0)