changeset 30896:b9116befa784

runtests: catch EPROTONOSUPPORT in checkportisavailable This is a follow-up of "runtests: check ports on IPv6 address". On some platforms, "socket.AF_INET6" exists while that does not necessarily mean the platform support IPv6 - when initializing a socket using "socket.socket", it could fail with EPROTONOSUPPORT. So treat that as "Port unavailable".
author Jun Wu <quark@fb.com>
date Fri, 10 Feb 2017 04:09:06 -0800
parents c32454d69b85
children 253d5c0f3a2f
files tests/run-tests.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Tue Feb 07 23:24:47 2017 -0800
+++ b/tests/run-tests.py	Fri Feb 10 04:09:06 2017 -0800
@@ -124,7 +124,8 @@
             s.close()
             return True
         except socket.error as exc:
-            if exc.errno not in (errno.EADDRINUSE, errno.EADDRNOTAVAIL):
+            if exc.errno not in (errno.EADDRINUSE, errno.EADDRNOTAVAIL,
+                                 errno.EPROTONOSUPPORT):
                 raise
     return False