Re: [Python-Dev] PEP-419: Protecting cleanup statements from interruptions

2012-04-19 Thread Victor Stinner
> PEP: 419 > Title: Protecting cleanup statements from interruptions > Version: $Revision$ > Last-Modified: $Date$ > Author: Paul Colomiets > Status: Draft > Type: Standards Track > Content-Type: text/x-rst > Created: 06-Apr-2012 > Python-Version: 3.3 Hi, I think your PEP should at least mention

Re: [Python-Dev] PEP-419: Protecting cleanup statements from interruptions

2012-04-09 Thread Paul Colomiets
Hi Benjamin, On Mon, Apr 9, 2012 at 12:42 AM, Benjamin Peterson wrote: > 2012/4/8 Paul Colomiets : >> Function 'sys.setcleanuphook' >> - >> >> A new function for the ``sys`` module is proposed.  This function sets >> a callback which is executed every time ``f_in_clean

Re: [Python-Dev] PEP-419: Protecting cleanup statements from interruptions

2012-04-08 Thread Paul Colomiets
Hi Antoine, On Mon, Apr 9, 2012 at 12:06 AM, Antoine Pitrou wrote: > > 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 >> >>     de

Re: [Python-Dev] PEP-419: Protecting cleanup statements from interruptions

2012-04-08 Thread Benjamin Peterson
2012/4/8 Paul Colomiets : > Function 'sys.setcleanuphook' > - > > A new function for the ``sys`` module is proposed.  This function sets > a callback which is executed every time ``f_in_cleanup`` becomes > false.  Callbacks get a frame object as their sole argument, so t

Re: [Python-Dev] PEP-419: Protecting cleanup statements from interruptions

2012-04-08 Thread Antoine Pitrou
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 Non

[Python-Dev] PEP-419: Protecting cleanup statements from interruptions

2012-04-08 Thread Paul Colomiets
Hi, I present my first PEP. http://www.python.org/dev/peps/pep-0419/ Added text to the end of email for easier reference. Comments are welcome. -- Paul PEP: 419 Title: Protecting cleanup statements from interruptions Version: $Revision$ Last-Modified: $Date$ Author: Paul Colomiets Status: