Skip to content

Commit c1998b7

Browse files
committed
fix check for None type in _get_parser
1 parent 94b3696 commit c1998b7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fgpyo/util/inspect.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ def split_at_given_level(
7070
return out_vals
7171

7272

73+
NoneType = type(None)
74+
75+
7376
def _get_parser(
7477
cls: Type, type_: TypeAlias, parsers: Optional[Dict[type, Callable[[str], Any]]] = None
7578
) -> partial:
@@ -226,7 +229,7 @@ def dict_parse(dict_string: str) -> Dict[Any, Any]:
226229
return types.make_enum_parser(type_)
227230
elif types.is_constructible_from_str(type_):
228231
return functools.partial(type_)
229-
elif isinstance(type_, type(type(None))):
232+
elif type_ == NoneType:
230233
return functools.partial(types.none_parser)
231234
elif types.get_origin_type(type_) is Union:
232235
return types.make_union_parser(

0 commit comments

Comments
 (0)