Skip to content

Commit 85f3973

Browse files
committed
Respond to initial review
1 parent 5bddbad commit 85f3973

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/typing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)