From patchwork Sun Apr 10 00:42:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: chgserver: do not print traceback on SystemExit From: Jun Wu X-Patchwork-Id: 14478 Message-Id: <3efb9e44023397f21243.1460248979@x1c> To: Date: Sun, 10 Apr 2016 01:42:59 +0100 # HG changeset patch # User Jun Wu # 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. This patch addresses the issue by adding SystemExit to the ignoring list. 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 finally: sv.cleanup()