Avoid nested SIGINT handling

Paulo da Silva p_d_a_s_i_l_v_a_ns at nonetnoaddress.pt
Wed Nov 10 16:37:52 EST 2021


Hi!

How do I handle a SIGINT (or any other signal) avoid nesting?

Does this work?

class STATUS:
	InInt=False

def SIGINT_handler(sn,f):
	if STATUS.InInt: return
	STATUS.InInt=True
	process_int()
	STATUS.InInt=False

Thanks for any suggestions.
Paulo


More information about the Python-list mailing list