File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -912,9 +912,14 @@ def _get_dispatch_annotation(func, param):
912912 ref_or_typeform = annotationlib .ForwardRef (ref_or_typeform , owner = func )
913913 if isinstance (ref_or_typeform , annotationlib .ForwardRef ):
914914 try :
915- return ref_or_typeform .evaluate (owner = func )
915+ ref_or_typeform = ref_or_typeform .evaluate (owner = func )
916916 except Exception :
917917 pass # Forward reference is unresolved.
918+ if ref_or_typeform is None :
919+ ref_or_typeform = type (None )
920+ if not isinstance (ref_or_typeform , annotationlib .ForwardRef ):
921+ import typing
922+ ref_or_typeform = typing ._strip_annotations (ref_or_typeform )
918923 return ref_or_typeform
919924
920925def _get_dispatch_param_and_annotation (func , * , skip_first = False ):
You can’t perform that action at this time.
0 commit comments