[Pyrex] possible bug with public function declarations

Robby Dermody robbyd at u20.org
Sun Feb 20 01:25:47 CET 2005


Hey guys,

I'm thinking there may be a possible bug with public C function
declarations in Pyrex 0.93.

Say for example, I have a function in foo.pyx:
-----
cdef public void Foo() except *:
	print "foo"
	assert 0
	print "bar"
-----

and bar.pyx looks like this:
-----
include "foo.pxi"
def myfunc():
	Foo()
-----

The project is set up so that foo.pyx and bar.pyx are linked together,
and Foo() can be properly called. In this case, the exception generated
in Foo() however, while propagated, isn't checked after it is called in
myfunc(). (On the screen, I see "foo", then after the assertion
triggers, the function returns, but no traceback is given.)

After hunting this down, I figured out the reason for this. It looks
like with the foo.pxi file generated by pyrex, Foo()'s declaration is
generated as:

cdef extern void (Foo())
insead of:
cdef extern void (Foo() except *)

When I changed this manually, everything worked as it should. Is this a
bug?


Robby
-- 
Robby Dermody <robbyd at u20.org>




More information about the Pyrex mailing list