Skip to content

Commit 09365a7

Browse files
committed
directly look for typing._GenericAlias
1 parent 580e136 commit 09365a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ghapp/ghapp/cattrs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _register_ignore_optional_none(cls, converter=None):
5151
prev_unstructure = converter._unstructure_func.dispatch(cls)
5252
optional_attrs = {
5353
f.name for f in attr.fields(cls)
54-
if isinstance(f.type, typing.Union) and type(None) in f.type.__args__
54+
if isinstance(f.type, typing._GenericAlias) and type(None) in f.type.__args__
5555
}
5656

5757
def unstructure_ignoring_optional_none(obj):

0 commit comments

Comments
 (0)