comparison mercurial/scmutil.py @ 41288:17941fc53ae9

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
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 16 Jan 2019 16:49:15 -0800
parents 24a1f67bb75a
children 5079242abef9
comparison
equal deleted inserted replaced
41287:c0221d929eb9 41288:17941fc53ae9
10 import errno 10 import errno
11 import glob 11 import glob
12 import hashlib 12 import hashlib
13 import os 13 import os
14 import re 14 import re
15 import socket
16 import subprocess 15 import subprocess
17 import weakref 16 import weakref
18 17
19 from .i18n import _ 18 from .i18n import _
20 from .node import ( 19 from .node import (
268 ui.error(_("abort: out of memory\n")) 267 ui.error(_("abort: out of memory\n"))
269 except SystemExit as inst: 268 except SystemExit as inst:
270 # Commands shouldn't sys.exit directly, but give a return code. 269 # Commands shouldn't sys.exit directly, but give a return code.
271 # Just in case catch this and and pass exit code to caller. 270 # Just in case catch this and and pass exit code to caller.
272 return inst.code 271 return inst.code
273 except socket.error as inst:
274 ui.error(_("abort: %s\n") % stringutil.forcebytestr(inst.args[-1]))
275 272
276 return -1 273 return -1
277 274
278 def checknewlabel(repo, lbl, kind): 275 def checknewlabel(repo, lbl, kind):
279 # Do not use the "kind" parameter in ui output. 276 # Do not use the "kind" parameter in ui output.