changeset 48956:c194e93d1ebc

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
author Kyle Lippincott <spectral@google.com>
date Wed, 09 Mar 2022 21:26:58 -0800
parents db960032d522
children edab75a4c1da
files tests/run-tests.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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