A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-April/118610.html below:

Protecting cleanup statements from interruptions

[Python-Dev] PEP-419: Protecting cleanup statements from interruptions [Python-Dev] PEP-419: Protecting cleanup statements from interruptionsAntoine Pitrou solipsis at pitrou.net
Sun Apr 8 23:06:14 CEST 2012
Hello Paul,

Thanks for the PEP and the description of the various issues.

> An example implementation of a SIGINT handler that interrupts safely
> might look like::
> 
>     import inspect, sys, functools
> 
>     def sigint_handler(sig, frame):
>         if inspect.getcleanupframe(frame) is None:
>             raise KeyboardInterrupt()
>         sys.setcleanuphook(functools.partial(sigint_handler, 0))

It is not clear whether you are proposing this for the default signal
handler, or only as an example that third-party libraries or frameworks
could implement.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4