[29370] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Exit quietly from k5test scripts on interrupt

daemon@ATHENA.MIT.EDU (Greg Hudson)
Fri Apr 8 17:23:05 2016

Date: Fri, 8 Apr 2016 17:22:59 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201604082122.u38LMxev011646@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/1eff2df7244c9a64729ba4799c8cbb17572081c5
commit 1eff2df7244c9a64729ba4799c8cbb17572081c5
Author: Greg Hudson <ghudson@mit.edu>
Date:   Sun Mar 13 12:20:43 2016 -0400

    Exit quietly from k5test scripts on interrupt
    
    Set up a SIGINT handler in k5test.py to avoid printing a stack trace
    or debugging instructions on control-C.

 src/util/k5test.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/util/k5test.py b/src/util/k5test.py
index c1df32f..ff86bd9 100644
--- a/src/util/k5test.py
+++ b/src/util/k5test.py
@@ -448,6 +448,14 @@ def _onexit():
         print '--stop-after=NUM to stop after a daemon is started in order to'
         print 'attach to it with a debugger.  Use --help to see other options.'
 
+
+def _onsigint(signum, frame):
+    # Exit without displaying a stack trace.  Suppress messages from _onexit.
+    global _success
+    _success = True
+    sys.exit(1)
+
+
 # Find the parent of dir which is at the root of a build or source directory.
 def _find_root(dir):
     while True:
@@ -1198,6 +1206,7 @@ _current_pass = None
 _daemons = []
 _parse_args()
 atexit.register(_onexit)
+signal.signal(signal.SIGINT, _onsigint)
 _outfile = open('testlog', 'w')
 _cmd_index = 1
 buildtop = _find_buildtop()
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post