Commit 698f231 1 parent 6e7f676 commit 698f231 Copy full SHA for 698f231
File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,12 @@ def __concretize(
56
56
hint_origin = get_origin (hint )
57
57
hint_args = get_args (hint )
58
58
if hint_origin and hint_args and hint_origin is not Literal :
59
- concretized = tuple (__concretize (a , generics , data_class ) for a in hint_args )
60
- if concretized != hint_args :
59
+ concrete_hint_args = tuple (__concretize (a , generics , data_class ) for a in hint_args )
60
+ if concrete_hint_args != hint_args :
61
+ if sys .version_info .minor >= 9 :
62
+ return hint_origin [concrete_hint_args ]
61
63
try :
62
- hint .__args__ = concretized
64
+ hint .__args__ = concrete_hint_args
63
65
except AttributeError as err :
64
66
raise DaciteError (f"Could not set __args__ on { hint } [original error: { err } ]" ) from None
65
67
You can’t perform that action at this time.
0 commit comments