[Cython] How access and modify errno?
Robert Bradshaw
robertwb at math.washington.edu
Fri Feb 6 23:50:44 CET 2009
On Feb 6, 2009, at 2:38 PM, Christian Heimes wrote:
> Hi fellow Cython users!
>
> I need to set errno = 0 and later check it for != 0. How can I stop
> Cython from mangling the name of my errno variable?
>
> Example code:
>
> cdef extern from "errno.h":
> int errno
>
> def method():
global errno
> errno = 0
>
> The Cython compiler insists on creating a new local variable "int
> __pyx_v_errno" for errno. Is there a way to stop Cython from doing
> that
> or do I have to use an extra header file with some macro magic?
No. Cython scoping is just like Python scoping--an assignment creates
a local in the given scope.
- Robert
More information about the Cython-dev
mailing list