Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 549:92b60cabf808
[PATCH] Catch OSError usefully
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[PATCH] Catch OSError usefully
From: Bryan O'Sullivan <bos@serpentine.com>
This is a rewrite of an earlier clone cleanup patch. Catches OSError
properly.
manifest hash: b1faf01867195a992a9ada0edb2095f85ab3e68f
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCxPSnywK+sNU5EO8RAmX4AJ9KG8MFZc7B79ZW22Qd7aQ4KyxUHwCgnkJz
Mj0FkpW+uccoSqKc2pxxv5k=
=LW+l
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Thu, 30 Jun 2005 23:45:43 -0800 |
parents | 4fc63e22b1fe |
children | f2442a6a5893 |
comparison
equal
deleted
inserted
replaced
548:e2e963e255fd | 549:92b60cabf808 |
---|---|
906 u.warn("abort: error %d: %s\n" % (inst.reason[0], inst.reason[1])) | 906 u.warn("abort: error %d: %s\n" % (inst.reason[0], inst.reason[1])) |
907 elif hasattr(inst, "args") and inst[0] == errno.EPIPE: | 907 elif hasattr(inst, "args") and inst[0] == errno.EPIPE: |
908 u.warn("broken pipe\n") | 908 u.warn("broken pipe\n") |
909 else: | 909 else: |
910 raise | 910 raise |
911 except OSError, inst: | |
912 if hasattr(inst, "filename"): | |
913 u.warn("abort: %s: %s\n" % (inst.strerror, inst.filename)) | |
914 else: | |
915 u.warn("abort: %s\n" % inst.strerror) | |
911 except TypeError, inst: | 916 except TypeError, inst: |
912 # was this an argument error? | 917 # was this an argument error? |
913 tb = traceback.extract_tb(sys.exc_info()[2]) | 918 tb = traceback.extract_tb(sys.exc_info()[2]) |
914 if len(tb) > 2: # no | 919 if len(tb) > 2: # no |
915 raise | 920 raise |