# HG changeset patch # User Martin von Zweigbergk # Date 2019-01-17 00:49:15 # Node ID 17941fc53ae90a2a12fc4f2a34fc7f231a79de33 # Parent c0221d929eb9184957620d8c9bb17e6cd09f6e1e 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 diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -12,7 +12,6 @@ import glob import hashlib import os import re -import socket import subprocess import weakref @@ -270,8 +269,6 @@ def callcatch(ui, func): # 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