File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -274,22 +274,22 @@ def _collect_parameters(args):
274274 parameters .append (collected )
275275 elif hasattr (t , '__typing_subst__' ):
276276 if t not in parameters :
277- if t .__default__ is not None :
277+ if hasattr ( t , "__default__" ) and t .__default__ is not None :
278278 seen_default = True
279279 elif seen_default :
280280 raise TypeError (
281- f"TypeVarLike { t !r} without a default follows one with a default"
281+ f"Type parameter { t !r} without a default follows one with a default"
282282 )
283283
284284 parameters .append (t )
285285 else :
286286 for x in getattr (t , '__parameters__' , ()):
287287 if x not in parameters :
288- if x .__default__ is not None :
288+ if hasattr ( x , "__default__" ) and x .__default__ is not None :
289289 seen_default = True
290290 elif seen_default :
291291 raise TypeError (
292- f"TypeVarLike { t !r} without a default follows one with a default"
292+ f"Type parameter { t !r} without a default follows one with a default"
293293 )
294294
295295 parameters .append (x )
You can’t perform that action at this time.
0 commit comments