tests: support another error case when detecting ipv4/ipv6 support
I encountered this on Linux in a VM environment with a rather strange networking
setup (both on the host and in the VM).
Differential Revision: https://phab.mercurial-scm.org/D12371
--- a/tests/run-tests.py Wed Mar 09 16:44:48 2022 +0100
+++ b/tests/run-tests.py Wed Mar 09 21:26:58 2022 -0800
@@ -238,10 +238,11 @@
s.bind(('localhost', port))
s.close()
return True
- except socket.error as exc:
+ except (socket.error, OSError) as exc:
if exc.errno == errno.EADDRINUSE:
return True
- elif exc.errno in (errno.EADDRNOTAVAIL, errno.EPROTONOSUPPORT):
+ elif exc.errno in (errno.EADDRNOTAVAIL, errno.EPROTONOSUPPORT,
+ errno.EAFNOSUPPORT):
return False
else:
raise