tests/run-tests.py
branchstable
changeset 47181 6e0af81c43b2
parent 47040 c853bc60c5d6
child 47182 dff19fe2973c
--- a/tests/run-tests.py	Mon Apr 12 20:58:19 2021 -0400
+++ b/tests/run-tests.py	Thu Mar 11 23:20:41 2021 -0500
@@ -262,7 +262,13 @@
     except socket.error as exc:
         if os.name == 'nt' and exc.errno == errno.WSAEACCES:
             return False
-        elif exc.errno not in (
+        elif PYTHON3:
+            # TODO: make a proper exception handler after dropping py2.  This
+            #       works because socket.error is an alias for OSError on py3,
+            #       which is also the baseclass of PermissionError.
+            if isinstance(exc, PermissionError):
+                return False
+        if exc.errno not in (
             errno.EADDRINUSE,
             errno.EADDRNOTAVAIL,
             errno.EPROTONOSUPPORT,