Andre Merzky added the comment: FWIW, a workaround seems to be a nested try/except clause:
try: try: do_lots_of_work() except RuntimeError as e: print 'signal handling worked' except RuntimeError: print 'signal handling delayed' I did a stress test over 100k runs, and got no unexpected behavior that way. I am not sure if the underlying race condition is just hidden, or if the inner except clause triggers the signal handling code internally -- either way, while cumbersome to use, it seems to work. I'd still appreciate feedback on a cleaner solution. Thanks, Andre. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27889> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com