tests: support another error case when detecting ipv4/ipv6 support
authorKyle Lippincott <spectral@google.com>
Wed, 09 Mar 2022 21:26:58 -0800
changeset 49047 c194e93d1ebc
parent 49046 db960032d522
child 49048 edab75a4c1da
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
tests/run-tests.py
--- 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