catch socket.error
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Fri, 29 Dec 2006 06:08:46 +0100
changeset 4013 54fa628b8c78
parent 4012 d1e31d7f7d44
child 4014 509342f95564
catch socket.error fix issue394
mercurial/commands.py
--- a/mercurial/commands.py	Fri Dec 29 05:27:48 2006 +0100
+++ b/mercurial/commands.py	Fri Dec 29 06:08:46 2006 +0100
@@ -11,7 +11,7 @@
 demandload(globals(), "bisect os re sys signal imp urllib pdb shlex stat")
 demandload(globals(), "fancyopts ui hg util lock revlog bundlerepo")
 demandload(globals(), "difflib patch time help mdiff tempfile")
-demandload(globals(), "traceback errno version atexit")
+demandload(globals(), "traceback errno version atexit socket")
 demandload(globals(), "archival changegroup cmdutil hgweb.server sshserver")
 
 class UnknownCommand(Exception):
@@ -3273,6 +3273,8 @@
                     u.warn(_("\nbroken pipe\n"))
             else:
                 raise
+    except socket.error, inst:
+        u.warn(_("abort: %s\n") % inst[1])
     except IOError, inst:
         if hasattr(inst, "code"):
             u.warn(_("abort: %s\n") % inst)