[Cython] 'with gil:' statement

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Mar 18 00:32:55 CET 2011


Dag Sverre Seljebotn wrote:

> def f():
>     with nogil:
>         for ...:
>             A
>             if something_exceptional:
>                 with gil:
>                     raise Exception(...)
>             B
>         C

If that's to be supported, the following really ought to be
supported as well:

   def f():
      with nogil:
         try:
            ...
            with gil:
               raise Exception()
         finally:
            ...do some cleanup...

-- 
Greg


More information about the cython-devel mailing list