[Python-checkins] bpo-37199: Fix test failures when IPv6 is unavailable or disabled (#14480)