[PATCH] chgserver: do not print traceback on SystemExit
Yuya Nishihara
yuya at tcha.org
Sun Apr 10 07:36:35 EDT 2016
On Sun, 10 Apr 2016 01:42:59 +0100, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1460248929 -3600
> # Sun Apr 10 01:42:09 2016 +0100
> # Node ID 3efb9e44023397f212437d89bfd7268cb5a15df6
> # Parent a212504cf958742becab6fe518dab9b838f5bbf4
> chgserver: do not print traceback on SystemExit
>
> Before the patch, if some extension uses "sys.exit", chg will print an extra
> backtrace. We have ignored KeyboardInterrupt already, and it makes It makes
> sense to ignore SystemExit as well.
Can you show the stacktrace? I'm interested in which command can execute
that ugly sys.exit(). For "runcommand", SystemExit should be caught at dispatch.
> diff --git a/hgext/chgserver.py b/hgext/chgserver.py
> --- a/hgext/chgserver.py
> +++ b/hgext/chgserver.py
> @@ -559,7 +559,7 @@
> except IOError as inst:
> if inst.errno != errno.EPIPE:
> raise
> - except KeyboardInterrupt:
> + except (KeyboardInterrupt, SystemExit):
> pass
If it is a common problem, this line should be copied to commandserver.py.
More information about the Mercurial-devel
mailing list