Fix Python 3.8 compatibility of a TypeAlias.

Review Request #14008 — Created July 2, 2024 and submitted — Latest diff uploaded

Information

Review Board
release-7.x

Reviewers

We had one place where we were defining a TypeAlias using the
newer-style list[...] (and related), which doesn't work for Python
3.8. This works fine for type annotations on all versions, but for type
aliases, it's a runtime error. Luckily this was hidden behind a check
for TYPE_CHECKING so it didn't break production.

This change also moves a couple more things into the TYPE_CHECKING
block.

Ran unit tests.

Commits

Files