changeset 48858:9d01ab54df3f

tests: collapse elif PYTHON3 block PYTHON3 is always True now so this logic should be identical as to before. Differential Revision: https://phab.mercurial-scm.org/D12236
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 20 Feb 2022 13:19:21 -0700
parents 41c552a20716
children f928dec9add7
files tests/run-tests.py
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sun Feb 20 13:16:44 2022 -0700
+++ b/tests/run-tests.py	Sun Feb 20 13:19:21 2022 -0700
@@ -278,12 +278,11 @@
     except socket.error as exc:
         if WINDOWS and exc.errno == errno.WSAEACCES:
             return False
-        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
+        # 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.
+        elif isinstance(exc, PermissionError):
+            return False
         if exc.errno not in (
             errno.EADDRINUSE,
             errno.EADDRNOTAVAIL,