Skip to content

Commit

Permalink
fix optional check
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Aug 5, 2021
1 parent 481f665 commit 1711a8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion magicgui/type_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _normalize_type(value: Any, annotation: Any) -> tuple[type, bool]:
origin = get_origin(annotation)
args = get_args(annotation)
if origin is Union and len(args) == 2 and type(None) in args:
type_ = next(i for i in args if not issubclass(i, type(None)))
type_ = next(i for i in args if not isinstance(i, type(None)))
return type_, True
return (origin or annotation), False

Expand Down

0 comments on commit 1711a8e

Please sign in to comment.