bpo-40121: Fix exception type in test (GH-19267)

(cherry picked from commit 3ef4a7e5a7c29e17d5152d1fa6ceeb1fee269699)

Co-authored-by: Steve Dower <steve.dower@python.org>
1 file changed