scmutil: drop unreachable except clause
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 16 Jan 2019 16:49:15 -0800
changeset 41288 17941fc53ae9
parent 41287 c0221d929eb9
child 41289 593f6359681d
scmutil: drop unreachable except clause socket.error is a subclass of IOError, which we catch higher up. It seems to have been this way since 020a896a5292 (dispatch: sort exception handlers, 2009-01-12), so let's celebrate the 10 year anniversary (a few days late) of it being wrong by deleting it. Differential Revision: https://phab.mercurial-scm.org/D5626
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Wed Jan 16 21:32:15 2019 -0800
+++ b/mercurial/scmutil.py	Wed Jan 16 16:49:15 2019 -0800
@@ -12,7 +12,6 @@
 import hashlib
 import os
 import re
-import socket
 import subprocess
 import weakref
 
@@ -270,8 +269,6 @@
         # Commands shouldn't sys.exit directly, but give a return code.
         # Just in case catch this and and pass exit code to caller.
         return inst.code
-    except socket.error as inst:
-        ui.error(_("abort: %s\n") % stringutil.forcebytestr(inst.args[-1]))
 
     return -1