Revision: 317
http://assorted.svn.sourceforge.net/assorted/?rev=317&view=rev
Author: yangzhang
Date: 2008-02-04 10:56:28 -0800 (Mon, 04 Feb 2008)
Log Message:
-----------
added signal test
Added Paths:
-----------
sandbox/trunk/src/py/signals.py
Added: sandbox/trunk/src/py/signals.py
===================================================================
--- sandbox/trunk/src/py/signals.py (rev 0)
+++ sandbox/trunk/src/py/signals.py 2008-02-04 18:56:28 UTC (rev 317)
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+from signal import *
+from time import *
+
+# without this handler installed, killing our process with sigterm won't
+# actually trigger the `finally`
+def f(a,b): raise KeyboardInterrupt
+signal( SIGTERM, f )
+
+try: sleep(1000)
+except: print 'except'
+finally: print 'finally'
Property changes on: sandbox/trunk/src/py/signals.py
___________________________________________________________________
Name: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|