D5626: scmutil: drop unreachable except clause
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Thu Jan 17 05:50:03 UTC 2019
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
socket.error is a subclass of IOError, which we catch higher up. It
seems to have been this way since https://phab.mercurial-scm.org/rHG020a896a5292b647a920026135c608e08864ca54 (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.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5626
AFFECTED FILES
mercurial/scmutil.py
CHANGE DETAILS
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -270,8 +270,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
To: martinvonz, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list