bpo-37199: Fix test failures when IPv6 is unavailable or disabled (GH-14480)

(cherry picked from commit c2cda638d63b98f5cf9a8ef13e15aace2b7e3f0b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
5 files changed